
********************************************************************************
**** Covid-19 Crisis and Hostility against Foreigners 
**** Tables
*******************************************************************************

log using "$logpath/02_tables", replace

***************************************************************************************************
** Table 1 - Mean allocations 
***************************************************************************************************
{
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear


****************************************************************************************************
* Z-statistics and P values from a Wilcoxon rank-sum equality test are reported whenever number of observations the same as number of clusters. 
* Somer’s D z-statistics and p-values clustered at individual level are reported whenever we have more observations than clusters.

*DOMESTIC, FOREIGN 
ttest HHT if (type_index=="DOMESTIC") , by(covid_prime)
ranksum HHT if (type_index=="DOMESTIC") , by(covid_prime)
ttest HHT if (type_index=="FOREIGN") , by(covid_prime)
somersd HHT covid_prime if (type_index=="FOREIGN"), cluster(respondentId)

	*FOREIGN vs. DOMESTIC
	ttest HHT if (type_index=="DOMESTIC"| type_index=="FOREIGN"), by(outgroup)
	ttest HHT if (type_index=="DOMESTIC"| type_index=="FOREIGN") & covid_prime==0, by(outgroup)
	ttest HHT if (type_index=="DOMESTIC"| type_index=="FOREIGN") & covid_prime==1, by(outgroup)
	somersd HHT outgroup if (type_index=="DOMESTIC"| type_index=="FOREIGN"), cluster(respondentId)
	somersd HHT outgroup if (type_index=="DOMESTIC"| type_index=="FOREIGN") & covid_prime==0, cluster(respondentId)
	somersd HHT outgroup if (type_index=="DOMESTIC"| type_index=="FOREIGN") & covid_prime==1, cluster(respondentId)

*DOMESTIC ingroup, DOMESTIC outgroup
ttest HHT if (type_index=="DOMESTIC ingroup"), by(covid_prime)
somersd HHT covid_prime if (type_index=="DOMESTIC ingroup"), cluster(respondentId)
ttest HHT if (type_index=="DOMESTIC outgroup"), by(covid_prime)
somersd HHT covid_prime if (type_index=="DOMESTIC outgroup"), cluster(respondentId)

	*DOMESTIC ingroup vs DOMESTIC outgroup
	ttest HHT if (type_index=="DOMESTIC ingroup" | type_index=="DOMESTIC outgroup"), by(outgroup)
	ttest HHT if (type_index=="DOMESTIC ingroup" | type_index=="DOMESTIC outgroup") & covid_prime==0, by(outgroup)
	ttest HHT if (type_index=="DOMESTIC ingroup" | type_index=="DOMESTIC outgroup") & covid_prime==1, by(outgroup)
	somersd HHT outgroup if (type_index=="DOMESTIC ingroup" | type_index=="DOMESTIC outgroup"), cluster(respondentId)
	somersd HHT outgroup if (type_index=="DOMESTIC ingroup" | type_index=="DOMESTIC outgroup") & covid_prime==0, cluster(respondentId)
	somersd HHT outgroup if (type_index=="DOMESTIC ingroup" | type_index=="DOMESTIC outgroup") & covid_prime==1, cluster(respondentId)
	

****************************************************************************************************
*Foreign

*Asia
ttest HHT if (type_group=="Asia"), by(covid_prime)
ranksum HHT if (type_group=="Asia"), by(covid_prime)

	*vs. Domestic
	ttest HHT if (type_index=="DOMESTIC"| type_group=="Asia"), by(outgroup)
	ttest HHT if (type_index=="DOMESTIC"| type_group=="Asia")  & covid_prime==0, by(outgroup)
	ttest HHT if (type_index=="DOMESTIC"| type_group=="Asia")  & covid_prime==1, by(outgroup)
		somersd HHT outgroup if (type_index=="DOMESTIC"| type_group=="Asia"), cluster(respondentId)
		somersd HHT outgroup if (type_index=="DOMESTIC"| type_group=="Asia") & covid_prime==0, cluster(respondentId)
		somersd HHT outgroup if (type_index=="DOMESTIC"| type_group=="Asia") & covid_prime==1, cluster(respondentId)
	 
*EU
ttest HHT if (type_group=="EU"), by(covid_prime)
ranksum HHT if (type_group=="EU"), by(covid_prime)
	*vs. Domestic
	ttest HHT if (type_index=="DOMESTIC"| type_group=="EU"), by(outgroup)
	ttest HHT if (type_index=="DOMESTIC"| type_group=="EU")  & covid_prime==0, by(outgroup)
	ttest HHT if (type_index=="DOMESTIC"| type_group=="EU")  & covid_prime==1, by(outgroup)
		somersd HHT outgroup if (type_index=="DOMESTIC"| type_group=="EU"), cluster(respondentId)
		somersd HHT outgroup if (type_index=="DOMESTIC"| type_group=="EU") & covid_prime==0, cluster(respondentId)
		somersd HHT outgroup if (type_index=="DOMESTIC"| type_group=="EU") & covid_prime==1, cluster(respondentId)
		
*USA
ttest HHT if (type_group=="USA"), by(covid_prime)
ranksum HHT if (type_group=="USA"), by(covid_prime)
 	*vs. Domestic
	ttest HHT if (type_index=="DOMESTIC"| type_group=="USA"), by(outgroup)
	ttest HHT if (type_index=="DOMESTIC"| type_group=="USA")  & covid_prime==0, by(outgroup)
	ttest HHT if (type_index=="DOMESTIC"| type_group=="USA")  & covid_prime==1, by(outgroup)
		somersd HHT outgroup if (type_index=="DOMESTIC"| type_group=="USA"), cluster(respondentId)
		somersd HHT outgroup if (type_index=="DOMESTIC"| type_group=="USA") & covid_prime==0, cluster(respondentId)
		somersd HHT outgroup if (type_index=="DOMESTIC"| type_group=="USA") & covid_prime==1, cluster(respondentId)
		
*Africa
ttest HHT if (type_group=="Africa"), by(covid_prime)
ranksum HHT if (type_group=="Africa"), by(covid_prime)
	*vs. Domestic
	 ttest HHT if (type_index=="DOMESTIC"| type_group=="Africa"), by(outgroup)
	 ttest HHT if (type_index=="DOMESTIC"| type_group=="Africa")  & covid_prime==0, by(outgroup)
	 ttest HHT if (type_index=="DOMESTIC"| type_group=="Africa")  & covid_prime==1, by(outgroup)
		somersd HHT outgroup if (type_index=="DOMESTIC"| type_group=="Africa"), cluster(respondentId)
		somersd HHT outgroup if (type_index=="DOMESTIC"| type_group=="Africa") & covid_prime==0, cluster(respondentId)
		somersd HHT outgroup if (type_index=="DOMESTIC"| type_group=="Africa") & covid_prime==1, cluster(respondentId)

****************************************************************************************************
*Domestic

*Region 
ttest HHT if (type_group=="Region ingroup"), by(covid_prime)
somersd HHT covid_prime if (type_group=="Region ingroup"), cluster(respondentId)
ttest HHT if (type_group=="Region outgroup"), by(covid_prime)
somersd HHT covid_prime if (type_group=="Region outgroup"), cluster(respondentId)
	*ingroup vs. outgroup
	 ttest HHT if (type_group=="Region ingroup" | type_group=="Region outgroup" ), by(outgroup)
	 ttest HHT if (type_group=="Region ingroup" | type_group=="Region outgroup" )  & covid_prime==0, by(outgroup)
	 ttest HHT if (type_group=="Region ingroup" | type_group=="Region outgroup" )  & covid_prime==1, by(outgroup)
	 somersd HHT outgroup if (type_group=="Region ingroup" | type_group=="Region outgroup" ), cluster(respondentId)
	 somersd HHT outgroup if (type_group=="Region ingroup" | type_group=="Region outgroup" )  & covid_prime==0, cluster(respondentId)
	 somersd HHT outgroup if (type_group=="Region ingroup" | type_group=="Region outgroup" )  & covid_prime==1, cluster(respondentId)
 
*Political
ttest HHT if (type_group=="Political ingroup"), by(covid_prime)
ranksum HHT if (type_group=="Political ingroup"), by(covid_prime)
ttest HHT if (type_group=="Political outgroup"), by(covid_prime)
ranksum HHT if (type_group=="Political outgroup"), by(covid_prime)
	*ingroup vs. outgroup
	  ttest HHT if (type_group=="Political ingroup" | type_group=="Political outgroup" ), by(outgroup)
	  ttest HHT if (type_group=="Political ingroup" | type_group=="Political outgroup" )  & covid_prime==0, by(outgroup)
	  ttest HHT if (type_group=="Political ingroup" | type_group=="Political outgroup" )  & covid_prime==1, by(outgroup)
		somersd HHT outgroup if (type_group=="Political ingroup" | type_group=="Political outgroup" ), cluster(respondentId)
		somersd HHT outgroup if (type_group=="Political ingroup" | type_group=="Political outgroup" )  & covid_prime==0, cluster(respondentId)
		somersd HHT outgroup if (type_group=="Political ingroup" | type_group=="Political outgroup" )  & covid_prime==1, cluster(respondentId)
		 
*Ethnic, Immigrant
ttest HHT if (type_group=="Majority ingroup"), by(covid_prime)
ranksum HHT if (type_group=="Majority ingroup"), by(covid_prime)
ttest HHT if (type_group=="Roma outgroup"), by(covid_prime)
ranksum HHT if (type_group=="Roma outgroup"), by(covid_prime)
ttest HHT if (type_group=="Immigrant outgroup"), by(covid_prime)
ranksum HHT if (type_group=="Immigrant outgroup"), by(covid_prime)

	*Majority vs. Roma
	 ttest HHT if (type_group=="Majority ingroup" | type_group=="Roma outgroup" ), by(outgroup)
	 ttest HHT if (type_group=="Majority ingroup" | type_group=="Roma outgroup" )  & covid_prime==0, by(outgroup)
	 ttest HHT if (type_group=="Majority ingroup" | type_group=="Roma outgroup" )  & covid_prime==1, by(outgroup)
		somersd HHT outgroup if (type_group=="Majority ingroup" | type_group=="Roma outgroup" ), cluster(respondentId)
		somersd HHT outgroup if (type_group=="Majority ingroup" | type_group=="Roma outgroup" )  & covid_prime==0, cluster(respondentId)
		somersd HHT outgroup if (type_group=="Majority ingroup" | type_group=="Roma outgroup" )  & covid_prime==1, cluster(respondentId)
	*Majority vs. Immigrant
	 ttest HHT if (type_group=="Majority ingroup" | type_group=="Immigrant outgroup" ), by(outgroup)
	 ttest HHT if (type_group=="Majority ingroup" | type_group=="Immigrant outgroup" )  & covid_prime==0, by(outgroup)
	 ttest HHT if (type_group=="Majority ingroup" | type_group=="Immigrant outgroup" )  & covid_prime==1, by(outgroup)
		somersd HHT outgroup if (type_group=="Majority ingroup" | type_group=="Immigrant outgroup" ), cluster(respondentId)
		somersd HHT outgroup if (type_group=="Majority ingroup" | type_group=="Immigrant outgroup" )  & covid_prime==0, cluster(respondentId)
		somersd HHT outgroup if (type_group=="Majority ingroup" | type_group=="Immigrant outgroup" )  & covid_prime==1, cluster(respondentId)
		 
*Religion
ttest HHT if (type_group=="Religion ingroup"), by(covid_prime)
ranksum HHT if (type_group=="Religion ingroup"), by(covid_prime)
ttest HHT if (type_group=="Religion outgroup"), by(covid_prime)
somersd HHT covid_prime if (type_group=="Religion outgroup"), cluster(respondentId)

*ingroup vs. outgroup
 ttest HHT if (type_group=="Religion ingroup" | type_group=="Religion outgroup"), by(outgroup)
 ttest HHT if (type_group=="Religion ingroup" | type_group=="Religion outgroup")  & covid_prime==0, by(outgroup)
 ttest HHT if (type_group=="Religion ingroup" | type_group=="Religion outgroup")  & covid_prime==1, by(outgroup)
	 somersd HHT outgroup if (type_group=="Religion ingroup" | type_group=="Religion outgroup" ), cluster(respondentId)
	 somersd HHT outgroup if (type_group=="Religion ingroup" | type_group=="Religion outgroup" )  & covid_prime==0, cluster(respondentId)
	 somersd HHT outgroup if (type_group=="Religion ingroup" | type_group=="Religion outgroup" )  & covid_prime==1, cluster(respondentId)
	 }
	
***************************************************************************************************
** Table 2. FOREIGN vs. Domestic, different controls and weights
{
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear

**********
**Panel A: Baseline controls
{

global x_controls $basic_controls

eststo clear
eststo  : reg HHT covid_prime  $x_controls if type_index=="DOMESTIC", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if type_index=="FOREIGN", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if type_group=="Asia", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if type_group=="EU", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if type_group=="USA", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if type_group=="Africa", cluster(respondentId)
	
	esttab using "$outputpath/Tables/Table_2_PanelA.csv", replace ///
	title(Effect of covid prime on pro/anti-social behavior: Foreign)  ///
	mtitle("Domestic" Foreign Asia EU USA Africa) ///
	keep(covid_prime) ///
	coeflabels(covid_prime "COVID") ///
	p brackets  nostar ///
	stats(N, fmt(0 0) labels("Observations"))
	* _cons
	estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)
}	

**********
**Panel B: no controls 
{

global x_controls 

eststo clear
eststo  : reg HHT covid_prime  $x_controls if type_index=="DOMESTIC", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if type_index=="FOREIGN", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if type_group=="Asia", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if type_group=="EU", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if type_group=="USA", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if type_group=="Africa", cluster(respondentId)
	
	esttab using "$outputpath/Tables/Table_2_PanelB.csv", replace ///
	title(Effect of covid prime on pro/anti-social behavior: Foreign)  ///
	mtitle("Domestic" Foreign Asia EU USA Africa) ///
	keep(covid_prime) ///
	coeflabels(covid_prime "COVID") ///
	p brackets nostar  ///
	stats(N, fmt(0 0) labels("Observations"))
	* _cons
	estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)
}	

**********
**Panel C: Full controls 
{

global x_controls $basic_controls $additional_controls

eststo clear
eststo  : reg HHT covid_prime  $x_controls if type_index=="DOMESTIC", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if type_index=="FOREIGN", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if type_group=="Asia", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if type_group=="EU", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if type_group=="USA", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if type_group=="Africa", cluster(respondentId)
	
	esttab using "$outputpath/Tables/Table_2_PanelC.csv", replace ///
	title(Effect of covid prime on pro/anti-social behavior: Foreign)  ///
	mtitle("Domestic" Foreign Asia EU USA Africa) ///
	keep(covid_prime) ///
	coeflabels(covid_prime "COVID") ///
	p brackets nostar  ///
	stats(N, fmt(0 0) labels("Observations"))
	* _cons
	estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)
}	



**********
**Panel D: probability weights 
{

global x_controls 

eststo clear
eststo  : reg HHT covid_prime  [pweight=repre_weights] if type_index=="DOMESTIC", cluster(respondentId)
		eststo  : reg HHT covid_prime  [pweight=repre_weights] if type_index=="FOREIGN", cluster(respondentId)
		eststo  : reg HHT covid_prime  [pweight=repre_weights] if type_group=="Asia", cluster(respondentId)
		eststo  : reg HHT covid_prime  [pweight=repre_weights] if type_group=="EU", cluster(respondentId)
		eststo  : reg HHT covid_prime  [pweight=repre_weights] if type_group=="USA", cluster(respondentId)
		eststo  : reg HHT covid_prime  [pweight=repre_weights] if type_group=="Africa", cluster(respondentId)
	esttab using "$outputpath/Tables/Table_2_PanelD.csv", replace ///
	title(Effect of covid prime on pro/anti-social behavior: Foreign)  ///
	mtitle("Domestic" Foreign Asia EU USA Africa) ///
	keep(covid_prime) ///
	coeflabels(covid_prime "COVID") ///
	p brackets nostar  ///
	stats(N, fmt(0 0) labels("Observations"))
	* _cons
	estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)
}	

*Means control
sum HHT if type_group=="DOMESTIC" & !covid_prime
sum HHT if type_index=="FOREIGN" & !covid_prime
sum HHT if type_group=="Asia" & !covid_prime
sum HHT if type_group=="EU" & !covid_prime
sum HHT if type_group=="USA" & !covid_prime 
sum HHT if type_group=="Africa" & !covid_prime


}


***************************************************************************************************
** Table S1 - Randomization check
***************************************************************************************************
{
	
use "$cleandatapath/covid_fuels_hostility_clean.dta", clear

*************************************
****Summary statistics
mean female d_age_cat* d_educ* d_estat1 d_estat2 d_estat6 d_estat5 d_estat3 estat_parent_other d_townsize* d_region* hsize children 
mean female d_age_cat* d_educ* d_estat1 d_estat2 d_estat6 d_estat5 d_estat3 estat_parent_other d_townsize* d_region* hsize children [pweight=repre_weights] 
mean d_hincome_above_median 
mean d_hincome_above_median [pweight=repre_weights]

orth_out female d_age_cat* d_educ* d_estat1 d_estat2 d_estat6 d_estat5 d_estat3 estat_parent_other d_townsize* d_region* hsize children d_hincome_above_median  , by(covid_prime) replace compare count bdec(2) 
orth_out d_hincome_above_median  , by(covid_prime) replace compare count bdec(2) 
*************************************
****Prime vs. no prime

tab female covid_prime, chi2
tab age_cat covid_prime, chi2 
tab educ covid_prime, chi2
tab estat covid_prime, chi2
tab townsize covid_prime, chi2
tab region covid_prime, chi2

*hh size/ number of children 
ttest hsize, by(covid_prime)
ranksum hsize, by(covid_prime)
ttest children, by(covid_prime)
ranksum children, by(covid_prime)

*hh_income (eq)
tab d_hincome_above_median covid_prime, chi2
}

*************************************************************************************************
** Table S2. FOREIGN vs. Domestic, interaction effects
{	
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear

global x_controls $basic_controls

eststo clear
*CZ vs. Foreign
eststo : reg HHT covid_prime outgroup covid_outgroup $x_controls if (type_index=="DOMESTIC" | type_index=="FOREIGN" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
* Asia
eststo: reg HHT covid_prime outgroup covid_outgroup $x_controls if (type_index=="DOMESTIC" | type_group=="Asia" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
* EU
eststo: reg HHT covid_prime outgroup covid_outgroup $x_controls if (type_index=="DOMESTIC" | type_group=="EU" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
* USA
eststo: reg HHT covid_prime outgroup covid_outgroup $x_controls if (type_index=="DOMESTIC" | type_group=="USA" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
* Africa
eststo: reg HHT covid_prime outgroup covid_outgroup $x_controls if (type_index=="DOMESTIC" | type_group=="Africa" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"

esttab using "$outputpath/Tables/Table_S2.csv", replace ///
	title(Effect of covid prime on pro/anti-social behavior: Foreign)  ///
	mtitle(Foreign Asia EU USA Africa) ///
	keep(covid_prime outgroup covid_outgroup) ///
	coeflabels(covid_prime "Covid" outgroup "Outgroup" covid_outgroup "Covid*Outgroup" _cons "Constant") ///
	p brackets nostar ///
	stats(cov_lintest sn_clust N, fmt(2 0) labels("Covid + Covid*Outgroup p-value" "# Clusters" "Observations"))
	* _cons
	estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime outgroup covid_outgroup)
	
	*Control mean
	sum HHT if type_index=="DOMESTIC" & !covid_prime
}

***************************************************************************************************
** Table S3. DOMESTIC ingroup vs. DOMESTIC outgroup, MAIN
{
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear

**********
**Panel A: Baseline controls
{

global x_controls $basic_controls

eststo clear
*All ingroup outgroup
eststo  : reg HHT covid_prime  $x_controls if (type_index=="DOMESTIC ingroup") , cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if (type_index=="DOMESTIC outgroup") , cluster(respondentId)
*Region
eststo  : reg HHT covid_prime  $x_controls if (type_group=="Region ingroup"), cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if (type_group=="Region outgroup"), cluster(respondentId)
*Political
eststo  : reg HHT covid_prime  $x_controls if (type_group=="Political ingroup"), cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if (type_group=="Political outgroup") , cluster(respondentId)
*Ethnicity
eststo  : reg HHT covid_prime  $x_controls if (type_group=="Majority ingroup"), cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if (type_group=="Roma outgroup"), cluster(respondentId)
*Migrant (chudak osamocenej)
eststo  : reg HHT covid_prime  $x_controls if (type_group=="Immigrant outgroup"), cluster(respondentId)
*Religion
eststo: reg HHT covid_prime $x_controls if (type_group=="Religion ingroup"), cluster(respondentId)
eststo: reg HHT covid_prime  $x_controls if (type_group=="Religion outgroup"), cluster(respondentId)

esttab using "$outputpath/Tables/Table_S3_PanelA.csv", replace  ///
	title(Effect of covid prime on pro/anti-social behavior: Foreign)  ///
	mtitle("Domestic IN" "Domestic OUT" "Region IN" "Region OUT" "Political IN" "Political OUT" "Ethnicity IN" "Ethnicity OUT" "Migrant OUT" "Religion IN" "Religion OUT") ///
	keep(covid_prime) ///
	coeflabels(covid_prime "COVID") ///
	p brackets nostar  ///
	stats(N, fmt(0 0) labels("Observations"))
	
estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)
}	

**********
**Panel B: no controls 
{

global x_controls 

eststo clear
*All ingroup outgroup
eststo  : reg HHT covid_prime  $x_controls if (type_index=="DOMESTIC ingroup") , cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if (type_index=="DOMESTIC outgroup") , cluster(respondentId)
*Region
eststo  : reg HHT covid_prime  $x_controls if (type_group=="Region ingroup"), cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if (type_group=="Region outgroup"), cluster(respondentId)
*Political
eststo  : reg HHT covid_prime  $x_controls if (type_group=="Political ingroup"), cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if (type_group=="Political outgroup") , cluster(respondentId)
*Ethnicity/Immigrant
eststo  : reg HHT covid_prime  $x_controls if (type_group=="Majority ingroup"), cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if (type_group=="Roma outgroup"), cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if (type_group=="Immigrant outgroup"), cluster(respondentId)
*Religion
eststo: reg HHT covid_prime $x_controls if (type_group=="Religion ingroup"), cluster(respondentId)
eststo: reg HHT covid_prime  $x_controls if (type_group=="Religion outgroup"), cluster(respondentId)

esttab using "$outputpath/Tables/Table_S3_PanelB.csv", replace  ///
	title(Effect of covid prime on pro/anti-social behavior: Foreign)  ///
	mtitle("Domestic IN" "Domestic OUT" "Region IN" "Region OUT" "Political IN" "Political OUT" "Ethnicity IN" "Ethnicity OUT" "Migrant OUT" "Religion IN" "Religion OUT") ///
	keep(covid_prime) ///
	coeflabels(covid_prime "COVID") ///
	p brackets nostar  ///
	stats(N, fmt(0 0) labels("Observations"))
	
estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)

}	
**********
**Panel C: Full controls 
{

global x_controls $basic_controls  $additional_controls

eststo clear
*All ingroup outgroup
eststo  : reg HHT covid_prime  $x_controls if (type_index=="DOMESTIC ingroup") , cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if (type_index=="DOMESTIC outgroup") , cluster(respondentId)
*Region
eststo  : reg HHT covid_prime  $x_controls if (type_group=="Region ingroup"), cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if (type_group=="Region outgroup"), cluster(respondentId)
*Political
eststo  : reg HHT covid_prime  $x_controls if (type_group=="Political ingroup"), cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if (type_group=="Political outgroup"), cluster(respondentId)
*Ethnicity
eststo  : reg HHT covid_prime  $x_controls if (type_group=="Majority ingroup"), cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if (type_group=="Roma outgroup"), cluster(respondentId)
*Migrant (chudak osamocenej)
eststo  : reg HHT covid_prime  $x_controls if (type_group=="Immigrant outgroup"), cluster(respondentId)
*Religion
eststo: reg HHT covid_prime $x_controls if (type_group=="Religion ingroup"), cluster(respondentId)
eststo: reg HHT covid_prime  $x_controls if (type_group=="Religion outgroup"), cluster(respondentId)

esttab using "$outputpath/Tables/Table_S3_PanelC.csv", replace  ///
	title(Effect of covid prime on pro/anti-social behavior: Foreign)  ///
	mtitle("Domestic IN" "Domestic OUT" "Region IN" "Region OUT" "Political IN" "Political OUT" "Ethnicity IN" "Ethnicity OUT" "Migrant OUT" "Religion IN" "Religion OUT") ///
	keep(covid_prime) ///
	coeflabels(covid_prime "COVID") ///
	p brackets nostar  ///
	stats(N, fmt(0 0) labels("Observations"))
	
estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)
}	



**********
**Panel D: probability weights 
{

global x_controls 

eststo clear
*All ingroup outgroup
eststo  : reg HHT covid_prime  [pweight=repre_weights] if (type_index=="DOMESTIC ingroup" ), cluster(respondentId)
eststo  : reg HHT covid_prime  [pweight=repre_weights]  if (type_index=="DOMESTIC outgroup") , cluster(respondentId)
*Region
eststo  : reg HHT covid_prime  [pweight=repre_weights]  if (type_group=="Region ingroup"), cluster(respondentId)
eststo  : reg HHT covid_prime  [pweight=repre_weights]  if (type_group=="Region outgroup"), cluster(respondentId)
*Political
eststo  : reg HHT covid_prime  [pweight=repre_weights]  if (type_group=="Political ingroup"), cluster(respondentId)
eststo  : reg HHT covid_prime  [pweight=repre_weights]  if (type_group=="Political outgroup") , cluster(respondentId)
*Ethnicity
eststo  : reg HHT covid_prime  [pweight=repre_weights]  if (type_group=="Majority ingroup"), cluster(respondentId)
eststo  : reg HHT covid_prime  [pweight=repre_weights]  if (type_group=="Roma outgroup"), cluster(respondentId)
*Migrant (chudak osamocenej)
eststo  : reg HHT covid_prime  [pweight=repre_weights] if (type_group=="Immigrant outgroup"), cluster(respondentId)
*Religion
eststo: reg HHT covid_prime [pweight=repre_weights]  if (type_group=="Religion ingroup"), cluster(respondentId)
eststo: reg HHT covid_prime  [pweight=repre_weights] if (type_group=="Religion outgroup"), cluster(respondentId)

esttab using "$outputpath/Tables/Table_S3_PanelD.csv", replace  ///
	title(Effect of covid prime on pro/anti-social behavior: Foreign)  ///
	mtitle("Domestic IN" "Domestic OUT" "Region IN" "Region OUT" "Political IN" "Political OUT" "Ethnicity IN" "Ethnicity OUT" "Migrant OUT" "Religion IN" "Religion OUT") ///
	keep(covid_prime) ///
	coeflabels(covid_prime "COVID") ///
	p brackets nostar  ///
	stats(N, fmt(0 0) labels("Observations"))

estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)
}	

*Means control
sum HHT if (type_index=="DOMESTIC ingroup") & !covid_prime
sum HHT if (type_index=="DOMESTIC outgroup")  & !covid_prime
sum HHT if (type_group=="Region ingroup") & !covid_prime
sum HHT if (type_group=="Region outgroup") & !covid_prime
sum HHT if (type_group=="Political ingroup") & !covid_prime 
sum HHT if (type_group=="Political outgroup") & !covid_prime
sum HHT if (type_group=="Majority ingroup") & !covid_prime
sum HHT if (type_group=="Roma outgroup") & !covid_prime
sum HHT if (type_group=="Immigrant outgroup") & !covid_prime
sum HHT if (type_group=="Religion ingroup") & !covid_prime
sum HHT if (type_group=="Religion outgroup") & !covid_prime

}

***************************************************************************************************
** Table S4. FOREIGN vs. Domestic, binary hostile/sending 0/pro-social/default
{
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear

**Panel A: Hostile acts
eststo clear
eststo  : reg antisocial covid_prime $basic_controls if type_index=="DOMESTIC", cluster(respondentId)
eststo  : reg antisocial covid_prime $basic_controls if type_index=="FOREIGN", cluster(respondentId)
eststo  : reg antisocial covid_prime $basic_controls if type_group=="Asia", cluster(respondentId)
eststo  : reg antisocial covid_prime $basic_controls if type_group=="EU", cluster(respondentId)
eststo  : reg antisocial covid_prime $basic_controls if type_group=="USA", cluster(respondentId)
eststo  : reg antisocial covid_prime $basic_controls if type_group=="Africa", cluster(respondentId)
	
esttab  using "$outputpath/Tables/Table_S4_PanelA.csv", replace ///
	title("Hostile acts")  ///
	mtitle("Domestic" Foreign Asia EU USA Africa) ///
	keep(covid_prime) ///
	coeflabels(covid_prime "COVID") ///
	p brackets  nostar ///
	stats(N, fmt(0 0) labels("Observations"))

estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)
		
		* Control means
		sum antisocial if covid_prime==0 & type_group=="DOMESTIC"
		sum antisocial if covid_prime==0 & type_index=="FOREIGN"
		sum antisocial if covid_prime==0 & type_group=="Asia"
		sum antisocial if covid_prime==0 & type_group=="EU"
		sum antisocial if covid_prime==0 & type_group=="USA"
		sum antisocial if covid_prime==0 & type_group=="Africa"
		
		*check probit
		*probit antisocial covid_prime $basic_controls if type_index=="DOMESTIC", cluster(respondentId)
		*mfx, var(covid_prime)
		*probit antisocial covid_prime $basic_controls if type_index=="FOREIGN", cluster(respondentId)
		*mfx, var(covid_prime)
		*probit antisocial covid_prime $basic_controls if type_group=="Asia", cluster(respondentId)
		*mfx, var(covid_prime)
		*probit antisocial covid_prime $basic_controls if type_group=="EU", cluster(respondentId)
		*mfx, var(covid_prime)
		*probit antisocial covid_prime $basic_controls if type_group=="USA", cluster(respondentId)
		*mfx, var(covid_prime)
		*probit antisocial covid_prime $basic_controls if type_group=="Africa", cluster(respondentId)
		*mfx, var(covid_prime)
		
***Panel B: Sending 0
gen HHT0=HHT==0
tab HHT HHT0

eststo clear
eststo  : reg HHT0 covid_prime $basic_controls if type_index=="DOMESTIC", cluster(respondentId)
eststo  : reg HHT0 covid_prime $basic_controls if type_index=="FOREIGN", cluster(respondentId)
eststo  : reg HHT0 covid_prime $basic_controls if type_group=="Asia", cluster(respondentId)
eststo  : reg HHT0 covid_prime $basic_controls if type_group=="EU", cluster(respondentId)
eststo  : reg HHT0 covid_prime $basic_controls if type_group=="USA", cluster(respondentId)
eststo  : reg HHT0 covid_prime $basic_controls if type_group=="Africa", cluster(respondentId)
	
esttab  using "$outputpath/Tables/Table_S4_PanelB.csv", replace ///
	title("Hostile acts")  ///
	mtitle("Domestic" Foreign Asia EU USA Africa) ///
	keep(covid_prime) ///
	coeflabels(covid_prime "COVID") ///
	p brackets  nostar ///
	stats(N, fmt(0 0) labels("Observations"))

estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)
		
		* Control means
		sum HHT0 if covid_prime==0 & type_group=="DOMESTIC"
		sum HHT0 if covid_prime==0 & type_index=="FOREIGN"
		sum HHT0 if covid_prime==0 & type_group=="Asia"
		sum HHT0 if covid_prime==0 & type_group=="EU"
		sum HHT0 if covid_prime==0 & type_group=="USA"
		sum HHT0 if covid_prime==0 & type_group=="Africa"
		
		*check probit
		*probit HHT0 covid_prime $basic_controls if type_index=="DOMESTIC", cluster(respondentId)
		*mfx, var(covid_prime)
		*probit HHT0 covid_prime $basic_controls if type_index=="FOREIGN", cluster(respondentId)
		*mfx, var(covid_prime)
		*probit HHT0 covid_prime $basic_controls if type_group=="Asia", cluster(respondentId)
		*mfx, var(covid_prime)
		*probit HHT0 covid_prime $basic_controls if type_group=="EU", cluster(respondentId)
		*mfx, var(covid_prime)
		*probit HHT0 covid_prime $basic_controls if type_group=="USA", cluster(respondentId)
		*mfx, var(covid_prime)
		*probit HHT0 covid_prime $basic_controls if type_group=="Africa", cluster(respondentId)
		*mfx, var(covid_prime)

	
**Panel C: Prosocial acts
eststo clear
eststo  : reg altruistic covid_prime $basic_controls if type_index=="DOMESTIC", cluster(respondentId)
eststo  : reg altruistic covid_prime $basic_controls if type_index=="FOREIGN", cluster(respondentId)
eststo  : reg altruistic covid_prime $basic_controls if type_group=="Asia", cluster(respondentId)
eststo  : reg altruistic covid_prime $basic_controls if type_group=="EU", cluster(respondentId)
eststo  : reg altruistic covid_prime $basic_controls if type_group=="USA", cluster(respondentId)
eststo  : reg altruistic covid_prime $basic_controls if type_group=="Africa", cluster(respondentId)

	
esttab using "$outputpath/Tables/Table_S4_PanelC.csv", replace ///
	title(Effect of covid prime on pro/anti-social behavior using binary variables: Foreign)  ///
	mtitle("Domestic" Foreign Asia EU USA Africa) ///
	keep(covid_prime) ///
	coeflabels(covid_prime "COVID") ///
	p brackets  nostar ///
	stats(N, fmt(0 0) labels("Observations"))
	
estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)

			* Control means
			sum altruistic if covid_prime==0 & type_group=="DOMESTIC"
			sum altruistic if covid_prime==0 & type_index=="FOREIGN"
			sum altruistic if covid_prime==0 & type_group=="Asia"
			sum altruistic if covid_prime==0 & type_group=="EU"
			sum altruistic if covid_prime==0 & type_group=="USA"
			sum altruistic if covid_prime==0 & type_group=="Africa"

			*check probit
			*probit altruistic  covid_prime $basic_controls if type_index=="DOMESTIC", cluster(respondentId)
			*mfx, var(covid_prime)
			*probit altruistic  covid_prime $basic_controls if type_index=="FOREIGN", cluster(respondentId)
			*mfx, var(covid_prime)
			*probit altruistic  covid_prime $basic_controls if type_group=="Asia", cluster(respondentId)
			*mfx, var(covid_prime)
			*probit altruistic  covid_prime $basic_controls if type_group=="EU", cluster(respondentId)
			*mfx, var(covid_prime)
			*probit altruistic  covid_prime $basic_controls if type_group=="USA", cluster(respondentId)
			*mfx, var(covid_prime)
			*probit altruistic covid_prime $basic_controls if type_group=="Africa", cluster(respondentId)
			*mfx, var(covid_prime)

**Panel D: Default
eststo clear
eststo  : reg stick_to_default covid_prime $basic_controls if type_index=="DOMESTIC", cluster(respondentId)
eststo  : reg stick_to_default covid_prime $basic_controls if type_index=="FOREIGN", cluster(respondentId)
eststo  : reg stick_to_default covid_prime $basic_controls if type_group=="Asia", cluster(respondentId)
eststo  : reg stick_to_default covid_prime $basic_controls if type_group=="EU", cluster(respondentId)
eststo  : reg stick_to_default covid_prime $basic_controls if type_group=="USA", cluster(respondentId)
eststo  : reg stick_to_default covid_prime $basic_controls if type_group=="Africa", cluster(respondentId)

	
esttab using "$outputpath/Tables/Table_S4_PanelD.csv", replace ///
	title(Effect of covid prime on pro/anti-social behavior using binary variables: Foreign)  ///
	mtitle("Domestic" Foreign Asia EU USA Africa) ///
	keep(covid_prime) ///
	coeflabels(covid_prime "COVID") ///
	p brackets  nostar ///
	stats(N, fmt(0 0) labels("Observations"))
	
estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)
	
sum stick_to_default if covid_prime==0 & type_group=="DOMESTIC"
sum stick_to_default if covid_prime==0 & type_index=="FOREIGN"
sum stick_to_default if covid_prime==0 & type_group=="Asia"
sum stick_to_default if covid_prime==0 & type_group=="EU"
sum stick_to_default if covid_prime==0 & type_group=="USA"
sum stick_to_default if covid_prime==0 & type_group=="Africa"
}	

***************************************************************************************************
** Table S5. Interaction-effects specification: Effect of the COVID-19 condition on the prevalence of extremely hostile behavior in the Help-or-Harm task, by the identity of the recipient (alternative domestic benchmark groups vs. foreign)
{
** Panel A: (FOREIGN vs. DOMESTIC)
{
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear
gen HHT0=HHT==0
replace HHT0=. if HHT==.
tab HHT HHT0

gen foreign = type_index=="FOREIGN"
gen covid_foreign=foreign*covid_prime

eststo clear
* FOREIGN
eststo  : reg HHT0 covid_prime foreign covid_foreign $basic_controls if type_index=="DOMESTIC" | type_index=="FOREIGN", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* Asia
eststo  : reg HHT0 covid_prime foreign covid_foreign $basic_controls if type_index=="DOMESTIC" | type_group=="Asia", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* EU
eststo  : reg HHT0 covid_prime foreign covid_foreign $basic_controls if type_index=="DOMESTIC" | type_group=="EU", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* USA
eststo  : reg HHT0 covid_prime foreign covid_foreign $basic_controls if type_index=="DOMESTIC" | type_group=="USA", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* Africa
eststo  : reg HHT0 covid_prime foreign covid_foreign $basic_controls if type_index=="DOMESTIC" | type_group=="Africa", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
	
esttab  using "$outputpath/Tables/Table_S5_PanelA.csv", replace ///
	title("Panel A: Extremely hostile behavior (= 1 if Help-or-Harm task allocation = 0)" ", Foreign vs. Domestic")  ///
	mtitle(Foreign Asia EU USA Africa) ///
	keep(covid_foreign) ///
	coeflabels(covid_prime "COVID" foreign "Foreign" covid_foreign "COVID*Foreign" _cons "Constant") ///
	p brackets  nostar ///
	stats(sn_clust N, fmt(2 0) labels("# Clusters" "Observations"))


}

** Panel B: (FOREIGN vs. majority Czech)
{
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear
gen HHT0=HHT==0
replace HHT0=. if HHT==.
tab HHT HHT0

gen foreign = type_index=="FOREIGN"
gen covid_foreign=foreign*covid_prime

eststo clear
* FOREIGN
eststo  : reg HHT0 covid_prime foreign covid_foreign $basic_controls if type_group=="Majority ingroup" | type_index=="FOREIGN", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* Asia
eststo  : reg HHT0 covid_prime foreign covid_foreign $basic_controls if type_group=="Majority ingroup" | type_group=="Asia", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* EU
eststo  : reg HHT0 covid_prime foreign covid_foreign $basic_controls if type_group=="Majority ingroup" | type_group=="EU", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* USA
eststo  : reg HHT0 covid_prime foreign covid_foreign $basic_controls if type_group=="Majority ingroup" | type_group=="USA", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* Africa
eststo  : reg HHT0 covid_prime foreign covid_foreign $basic_controls if type_group=="Majority ingroup" | type_group=="Africa", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
	
esttab  using "$outputpath/Tables/Table_S5_PanelB.csv", replace ///
	title("Panel B: Extremely hostile behavior (= 1 if Help-or-Harm task allocation = 0)" ", Foreign vs. Domestic majority")  ///
	mtitle(Foreign Asia EU USA Africa) ///
	keep(covid_foreign) ///
	coeflabels(covid_prime "COVID" foreign "Foreign" covid_foreign "COVID*Foreign" _cons "Constant") ///
	p brackets  nostar ///
	stats(sn_clust N, fmt(2 0) labels( "# Clusters" "Observations"))

}
** Panel C: (FOREIGN vs. DOMESTIC outgroup)
{
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear
gen HHT0=HHT==0
replace HHT0=. if HHT==.
tab HHT HHT0

gen foreign = type_index=="FOREIGN"
gen covid_foreign=foreign*covid_prime

eststo clear
* FOREIGN
eststo  : reg HHT0 covid_prime foreign covid_foreign $basic_controls if type_index=="DOMESTIC outgroup" | type_index=="FOREIGN", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* Asia
eststo  : reg HHT0 covid_prime foreign covid_foreign $basic_controls if type_index=="DOMESTIC outgroup" | type_group=="Asia", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* EU
eststo  : reg HHT0 covid_prime foreign covid_foreign $basic_controls if type_index=="DOMESTIC outgroup" | type_group=="EU", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* USA
eststo  : reg HHT0 covid_prime foreign covid_foreign $basic_controls if type_index=="DOMESTIC outgroup" | type_group=="USA", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* Africa
eststo  : reg HHT0 covid_prime foreign covid_foreign $basic_controls if type_index=="DOMESTIC outgroup" | type_group=="Africa", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
	
esttab  using "$outputpath/Tables/Table_S5_PanelC.csv", replace ///
	title("Panel C: Extremely hostile behavior (= 1 if Help-or-Harm task allocation = 0)" ", Foreign vs. Domestic out-group")  ///
	mtitle(Foreign Asia EU USA Africa) ///
	keep(covid_foreign) ///
	coeflabels(covid_prime "COVID" foreign "Foreign" covid_foreign "COVID*Foreign" _cons "Constant") ///
	p brackets  nostar ///
	stats(sn_clust N, fmt(2 0) labels("# Clusters" "Observations"))


}
** Panel D: (FOREIGN vs. region outgroup)
{
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear
gen HHT0=HHT==0
replace HHT0=. if HHT==.
tab HHT HHT0

gen foreign = type_index=="FOREIGN"
gen covid_foreign=foreign*covid_prime

eststo clear
* FOREIGN
eststo  : reg HHT0 covid_prime foreign covid_foreign $basic_controls if type_group=="Region outgroup" | type_index=="FOREIGN", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* Asia
eststo  : reg HHT0 covid_prime foreign covid_foreign $basic_controls if type_group=="Region outgroup" | type_group=="Asia", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* EU
eststo  : reg HHT0 covid_prime foreign covid_foreign $basic_controls if type_group=="Region outgroup" | type_group=="EU", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* USA
eststo  : reg HHT0 covid_prime foreign covid_foreign $basic_controls if type_group=="Region outgroup" | type_group=="USA", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* Africa
eststo  : reg HHT0 covid_prime foreign covid_foreign $basic_controls if type_group=="Region outgroup" | type_group=="Africa", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
	
esttab  using "$outputpath/Tables/Table_S5_PanelD.csv", replace ///
	title("Panel D: Extremely hostile behavior (= 1 if Help-or-Harm task allocation = 0)" ", Foreign vs. Region outgroup")  ///
	mtitle(Foreign Asia EU USA Africa) ///
	keep(covid_foreign) ///
	coeflabels(covid_prime "COVID" foreign "Foreign" covid_foreign "COVID*Foreign" _cons "Constant") ///
	p brackets  nostar ///
	stats(sn_clust N, fmt(2 0) labels("# Clusters" "Observations"))

}
}

***************************************************************************************************
** Table S6. FOREIGN vs. Domestic, sub-group analysis
{
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear

global x_controls $basic_controls

	
**********AGE
eststo clear
* Czech, young
quietly eststo het_czech_young: reg HHT covid_prime $basic_controls if type_index=="DOMESTIC" & age<50, cluster(respondentId)
* Foreign, young
quietly eststo het_foreign_young: reg HHT covid_prime $basic_controls if type_index=="FOREIGN" & age<50, cluster(respondentId)
* EU, young
quietly eststo het_EU_young: reg HHT covid_prime $basic_controls if type_group=="EU" & age<50, cluster(respondentId)
* Czech, old
quietly eststo het_czech_old: reg HHT covid_prime $basic_controls if type_index=="DOMESTIC" & age>=50, cluster(respondentId)
* Foreign, old
quietly eststo het_foreign_old: reg HHT covid_prime $basic_controls if type_index=="FOREIGN" & age>=50, cluster(respondentId)
* EU, old
quietly eststo het_EU_old: reg HHT covid_prime $basic_controls if type_group=="EU" & age>=50, cluster(respondentId)

esttab using "$outputpath/Tables/Table_S6_PanelA_age.csv", replace ///
	title(Heterogeneity: Age)  ///
	mtitle("Domestic" Foreign EU "Domestic" Foreign EU) ///
	keep(covid_prime) ///
	coeflabels(covid_prime "COVID") ///
	p brackets  nostar ///
	stats(N, fmt(0 0) labels("Observations"))
	* _cons

estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)

		*control means
		sum HHT if type_group=="DOMESTIC" & age<50 & covid_prime==0
		sum HHT if type_index=="FOREIGN" & age<50 & covid_prime==0
		sum HHT if type_group=="EU" & age<50 & covid_prime==0
		sum HHT if type_group=="DOMESTIC"  & age>=50 & covid_prime==0
		sum HHT if type_index=="FOREIGN"  & age>=50 & covid_prime==0
		sum HHT if type_group=="EU"  & age>=50 & covid_prime==0

**********GENDER
eststo clear
* Czech, male
quietly eststo het_czech_male: reg HHT covid_prime $basic_controls if type_index=="DOMESTIC" & female==0, cluster(respondentId)
* Foreign, male
quietly eststo het_foreign_male: reg HHT covid_prime $basic_controls if type_index=="FOREIGN" & female==0, cluster(respondentId)
* EU, male
quietly eststo het_EU_male: reg HHT covid_prime $basic_controls if type_group=="EU" & female==0, cluster(respondentId)
* Czech, female
quietly eststo het_czech_female: reg HHT covid_prime $basic_controls if type_index=="DOMESTIC" & female==1, cluster(respondentId)
* Foreign, female
quietly eststo het_foreign_female: reg HHT covid_prime $basic_controls if type_index=="FOREIGN" & female==1, cluster(respondentId)
* EU, female
quietly eststo het_EU_female: reg HHT covid_prime $basic_controls if type_group=="EU" & female==1, cluster(respondentId)
esttab using "$outputpath/Tables/Table_S6_PanelB_gender.csv", replace ///
title(Heterogeneity: Gender)  ///
	mtitle("Domestic" Foreign EU "Domestic" Foreign EU) ///
	keep(covid_prime) ///
	coeflabels(covid_prime "COVID") ///
	p brackets  nostar ///
	stats(N, fmt(0 0) labels("Observations"))
	* _cons
	
estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)
			
		*control means
		sum HHT if type_group=="DOMESTIC" & female==0 & covid_prime==0
		sum HHT if type_index=="FOREIGN" & female==0 & covid_prime==0
		sum HHT if type_group=="EU" & female==0 & covid_prime==0
		sum HHT if type_group=="DOMESTIC"  & female==1 & covid_prime==0
		sum HHT if type_index=="FOREIGN"  & female==1 & covid_prime==0
		sum HHT if type_group=="EU"  & female==1 & covid_prime==0
	
**********MUNICIPALITY SIZE
eststo clear
* Czech, cities
eststo het_czech_city: reg HHT covid_prime $basic_controls if type_index=="DOMESTIC" & townsize==7, cluster(respondentId)
* Foreign, cities
eststo het_foreign_city: reg HHT covid_prime $basic_controls if type_index=="FOREIGN" & townsize==7, cluster(respondentId)
* EU, cities
eststo het_EU_city: reg HHT covid_prime $basic_controls if type_group=="EU" & townsize==7, cluster(respondentId)
* Czech, villages/towns
quietly eststo het_czech_town: reg HHT covid_prime $basic_controls if type_index=="DOMESTIC" & townsize!=7, cluster(respondentId)
* Foreign, villages/towns
 eststo het_foreign_town: reg HHT covid_prime $basic_controls if type_index=="FOREIGN" & townsize!=7, cluster(respondentId)
* EU, villages/towns
quietly eststo het_EU_town: reg HHT covid_prime $basic_controls if type_group=="EU" & townsize!=7, cluster(respondentId)


esttab using "$outputpath/Tables/Table_S6_PanelC_municipality.csv", replace ///
title(Heterogeneity: Municipality size)  ///
	mtitle("Domestic" Foreign EU "Domestic" Foreign EU) ///
	keep(covid_prime) ///
	coeflabels(covid_prime "COVID") ///
	p brackets  nostar ///
	stats(N, fmt(0 0) labels("Observations"))
	* _cons
	
estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)
	
		*control means
		sum HHT if type_group=="DOMESTIC" & townsize==7 & covid_prime==0
		sum HHT if type_index=="FOREIGN" & townsize==7 & covid_prime==0
		sum HHT if type_group=="EU" & townsize==7 & covid_prime==0
		sum HHT if type_group=="DOMESTIC"  & townsize!=7 & covid_prime==0
		sum HHT if type_index=="FOREIGN"  & townsize!=7 & covid_prime==0
		sum HHT if type_group=="EU"  & townsize!=7 & covid_prime==0

**********EDUCATION
eststo clear
* Czech, higheduc
quietly eststo het_czech_higheduc: reg HHT covid_prime $basic_controls if type_index=="DOMESTIC" & educ==4, cluster(respondentId)
* Foreign, high educ
quietly eststo het_foreign_higheduc: reg HHT covid_prime $basic_controls if type_index=="FOREIGN" & educ==4, cluster(respondentId)
* EU, high educ
quietly eststo het_EU_higheduc: reg HHT covid_prime $basic_controls if type_group=="EU" & educ==4, cluster(respondentId)
* Czech, loweduc
quietly eststo het_czech_loweduc: reg HHT covid_prime $basic_controls if type_index=="DOMESTIC" & educ!=4, cluster(respondentId)
* Foreign, low educ
quietly eststo het_foreign_loweduc: reg HHT covid_prime $basic_controls if type_index=="FOREIGN" & educ!=4, cluster(respondentId)
* EU, low educ
quietly eststo het_EU_loweduc: reg HHT covid_prime $basic_controls if type_group=="EU" & educ!=4, cluster(respondentId)

esttab using "$outputpath/Tables/Table_S6_PanelD_educ.csv", replace ///
title(Heterogeneity: Education)  ///
	mtitle("Domestic" Foreign EU "Domestic" Foreign EU) ///
	keep(covid_prime) ///
	coeflabels(covid_prime "COVID") ///
	p brackets  nostar ///
	stats(N, fmt(0 0) labels("Observations"))
	* _cons
	
estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)
	
			*control means
		sum HHT if type_group=="DOMESTIC" & educ==4 & covid_prime==0
		sum HHT if type_index=="FOREIGN" & educ==4 & covid_prime==0
		sum HHT if type_group=="EU" & educ==4 & covid_prime==0
		sum HHT if type_group=="DOMESTIC"  & educ!=4 & covid_prime==0
		sum HHT if type_index=="FOREIGN"  & educ!=4 & covid_prime==0
		sum HHT if type_group=="EU"  & educ!=4 & covid_prime==0	

	

**********INCOME
eststo clear
* Czech, high inc
quietly eststo het_czech_highinc: reg HHT covid_prime $basic_controls if type_index=="DOMESTIC"  & CNP_hincome>=7, cluster(respondentId)
* Foreign, high inc
quietly eststo het_foreign_highinc: reg HHT covid_prime $basic_controls if type_index=="FOREIGN" & CNP_hincome>=7, cluster(respondentId)
* EU, high inc
quietly eststo het_EU_highinc: reg HHT covid_prime $basic_controls if type_group=="EU" & CNP_hincome>=7, cluster(respondentId)
* Czech, low inc
quietly eststo het_czech_lowinc: reg HHT covid_prime $basic_controls if type_index=="DOMESTIC" & CNP_hincome<7, cluster(respondentId)
* Foreign, low inc
quietly eststo het_foreign_lowinc: reg HHT covid_prime $basic_controls if type_index=="FOREIGN" & CNP_hincome<7, cluster(respondentId)
* EU, low inc
quietly eststo het_EU_lowinc: reg HHT covid_prime $basic_controls if type_group=="EU" & CNP_hincome<7, cluster(respondentId)

esttab using "$outputpath/Tables/Table_S6_PanelE_income.csv", replace ///
title(Heterogeneity: Income)  ///
	mtitle("Domestic" Foreign EU "Domestic" Foreign EU) ///
	keep(covid_prime) ///
	coeflabels(covid_prime "COVID") ///
	p brackets  nostar ///
	stats(N, fmt(0 0) labels("Observations"))
	* _cons
	
estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)
	
			*control means
		sum HHT if type_group=="DOMESTIC" & CNP_hincome>=7 & covid_prime==0
		sum HHT if type_index=="FOREIGN" & CNP_hincome>=7 & covid_prime==0
		sum HHT if type_group=="EU" & CNP_hincome>=7 & covid_prime==0
		sum HHT if type_group=="DOMESTIC"  & CNP_hincome<7 & covid_prime==0
		sum HHT if type_index=="FOREIGN"  & CNP_hincome<7 & covid_prime==0
		sum HHT if type_group=="EU"  & CNP_hincome<7 & covid_prime==0

}

***************************************************************************************************
** Table S7. DOMESTIC ingroup vs. DOMESTIC outgroup, interaction effects
{
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear
global x_controls $basic_controls

eststo clear
*Domestic ingroup vs. outgoup
eststo  : reg HHT covid_prime outgroup covid_outgroup $x_controls if (type_index=="DOMESTIC ingroup" | type_index=="DOMESTIC outgroup"), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
*Region
eststo: reg HHT covid_prime outgroup covid_outgroup $x_controls if (type_group=="Region ingroup" | type_group=="Region outgroup"), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
*Political
eststo : reg HHT covid_prime outgroup covid_outgroup $x_controls if (type_group=="Political ingroup" | type_group=="Political outgroup" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
*Majority vs. Roma 
eststo: reg HHT covid_prime outgroup covid_outgroup $x_controls if (type_group=="Majority ingroup" | type_group=="Roma outgroup" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
*Majority vs. Immigrant  
eststo m5: reg HHT covid_prime outgroup covid_outgroup $x_controls if (type_group=="Majority ingroup" | type_group=="Immigrant outgroup" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
*Religion ingroup vs. outgroup 
eststo: reg HHT covid_prime outgroup covid_outgroup $x_controls if (type_group=="Religion ingroup" | type_group=="Religion outgroup"), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"

esttab using "$outputpath/Tables/Table_S7_Domestic_interactions.csv", replace ///
	title(Effect of covid prime on pro/anti-social behavior: Domestic)  ///
	mtitle(DOMESTIC Region Political Ethnicity Immigrant Religion) ///
	keep(covid_prime outgroup covid_outgroup _cons) ///
	coeflabels(covid_prime "Covid" outgroup "Outgroup" covid_outgroup "Covid*Outgroup" _cons "Constant") ///
	p brackets nostar ///
	stats(cov_lintest sn_clust N, fmt(2 0) labels("Covid + Covid*Outgroup p-value" "# Clusters" "Observations"))
	*_cons

estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime outgroup covid_outgroup)

*Control means
sum HHT if type_index=="DOMESTIC ingroup" & !covid_prime
sum HHT if type_group=="Region ingroup" & !covid_prime
sum HHT if type_group=="Political ingroup" & !covid_prime
sum HHT if type_group=="Majority ingroup" & !covid_prime
sum HHT if type_group=="Religion ingroup" & !covid_prime
}

*************************************************************************************************
** Table S8. Interaction-effects specification: Effect of the COVID-19 condition on the prevalence of hostile and pro-social behavior in the Help-or-Harm task, by the identity of the recipient (DOMESTIC ingroup vs. DOMESTIC outgroup)
{	
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear

global x_controls $basic_controls

**Panel A: Hostile acts
eststo clear
* DOMESTIC ingroup vs. DOMESTIC outgroup
eststo : reg antisocial covid_prime outgroup covid_outgroup $x_controls if (type_index=="DOMESTIC ingroup" | type_index=="DOMESTIC outgroup" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
* Region ingroup vs. Region outgroup
eststo: reg antisocial covid_prime outgroup covid_outgroup $x_controls if (type_group=="Region ingroup" | type_group=="Region outgroup" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
* Political ingroup vs. Political outgroup
eststo: reg antisocial covid_prime outgroup covid_outgroup $x_controls if (type_group=="Political ingroup" | type_group=="Political outgroup" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
* Majority ingroup vs. Roma 
eststo: reg antisocial covid_prime outgroup covid_outgroup $x_controls if (type_group=="Majority ingroup" | type_group=="Roma outgroup"), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
* Majority ingroup Immigrant
eststo: reg antisocial covid_prime outgroup covid_outgroup $x_controls if (type_group=="Majority ingroup" | type_group=="Immigrant outgroup" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
* Religion ingroup vs. Religion outgroup
eststo: reg antisocial covid_prime outgroup covid_outgroup $x_controls if (type_group=="Religion ingroup" | type_group=="Religion outgroup" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"

esttab using "$outputpath/Tables/Table_S8_PanelA.csv", replace ///
	title("Panel A: Hostile behavior (= 1 if Help-or-Harm task allocation < 100) (DOMESTIC ingroup vs. DOMESTIC outgroup)")  ///
	mtitle(DOMESTIC Region Political Roma Immigrant Religion) ///
	keep(covid_prime outgroup covid_outgroup) ///
	coeflabels(covid_prime "Covid" outgroup "Outgroup" covid_outgroup "COVID*Outgroup" _cons "Constant") ///
	p brackets nostar ///
	stats(cov_lintest sn_clust N, fmt(2 0) labels("COVID + COVID*Outgroup p-value" "# Clusters" "Observations"))
	* _cons
	estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime outgroup covid_outgroup)

***Panel B: Sending 0
gen HHT0=HHT==0
tab HHT HHT0

eststo clear
* DOMESTIC ingroup vs. DOMESTIC outgroup
eststo : reg HHT0 covid_prime outgroup covid_outgroup $x_controls if (type_index=="DOMESTIC ingroup" | type_index=="DOMESTIC outgroup" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
* Region ingroup vs. Region outgroup
eststo: reg HHT0 covid_prime outgroup covid_outgroup $x_controls if (type_group=="Region ingroup" | type_group=="Region outgroup" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
* Political ingroup vs. Political outgroup
eststo: reg HHT0 covid_prime outgroup covid_outgroup $x_controls if (type_group=="Political ingroup" | type_group=="Political outgroup" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
* Majority ingroup vs. Roma
eststo: reg HHT0 covid_prime outgroup covid_outgroup $x_controls if (type_group=="Majority ingroup" | type_group=="Roma outgroup"), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
* Majority ingroup vs. Immigrant
eststo: reg HHT0 covid_prime outgroup covid_outgroup $x_controls if (type_group=="Majority ingroup" | type_group=="Immigrant outgroup" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
* Religion ingroup vs. Religion outgroup
eststo: reg HHT0 covid_prime outgroup covid_outgroup $x_controls if (type_group=="Religion ingroup" | type_group=="Religion outgroup" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"

esttab using "$outputpath/Tables/Table_S8_PanelB.csv", replace ///
	title("Panel B: Reducing the rewards to zero (=1 if Help-or-Harm task allocation = 0) (DOMESTIC ingroup vs. DOMESTIC outgroup)")  ///
	mtitle(DOMESTIC Region Political Roma Immigrant Religion) ///
	keep(covid_prime outgroup covid_outgroup) ///
	coeflabels(covid_prime "Covid" outgroup "Outgroup" covid_outgroup "COVID*Outgroup" _cons "Constant") ///
	p brackets nostar ///
	stats(cov_lintest sn_clust N, fmt(2 0) labels("COVID + COVID*Outgroup p-value" "# Clusters" "Observations"))
	* _cons
	estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime outgroup covid_outgroup)


**Panel C: Prosocial acts
eststo clear
* DOMESTIC ingroup vs. DOMESTIC outgroup
eststo : reg altruistic covid_prime outgroup covid_outgroup $x_controls if (type_index=="DOMESTIC ingroup" | type_index=="DOMESTIC outgroup" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
* Region ingroup vs. Region outgroup
eststo: reg altruistic covid_prime outgroup covid_outgroup $x_controls if (type_group=="Region ingroup" | type_group=="Region outgroup" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
* Political ingroup vs. Political outgroup
eststo: reg altruistic covid_prime outgroup covid_outgroup $x_controls if (type_group=="Political ingroup" | type_group=="Political outgroup" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
* Majority ingroup vs. Roma
eststo: reg altruistic covid_prime outgroup covid_outgroup $x_controls if (type_group=="Majority ingroup" | type_group=="Roma outgroup"), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
* Majority ingroup vs. Immigrant
eststo: reg altruistic covid_prime outgroup covid_outgroup $x_controls if (type_group=="Majority ingroup" | type_group=="Immigrant outgroup" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
* Religion ingroup vs. Religion outgroup
eststo: reg altruistic covid_prime outgroup covid_outgroup $x_controls if (type_group=="Religion ingroup" | type_group=="Religion outgroup" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"

esttab using "$outputpath/Tables/Table_S8_PanelC.csv", replace ///
	title("Panel C: Pro-social behavior (= 1 if Help-or-Harm task allocation > 100) (DOMESTIC ingroup vs. DOMESTIC outgroup)")  ///
	mtitle(DOMESTIC Region Political Roma Immigrant Religion) ///
	keep(covid_prime outgroup covid_outgroup) ///
	coeflabels(covid_prime "Covid" outgroup "Outgroup" covid_outgroup "COVID*Outgroup" _cons "Constant") ///
	p brackets nostar ///
	stats(cov_lintest sn_clust N, fmt(2 0) labels("COVID + COVID*Outgroup p-value" "# Clusters" "Observations"))
	* _cons
	estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime outgroup covid_outgroup)
	
**Panel D: Default
eststo clear
* DOMESTIC ingroup vs. DOMESTIC outgroup
eststo : reg stick_to_default covid_prime outgroup covid_outgroup $x_controls if (type_index=="DOMESTIC ingroup" | type_index=="DOMESTIC outgroup" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
* Region ingroup vs. Region outgroup
eststo: reg stick_to_default covid_prime outgroup covid_outgroup $x_controls if (type_group=="Region ingroup" | type_group=="Region outgroup" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
* Political ingroup vs. Political outgroup
eststo: reg stick_to_default covid_prime outgroup covid_outgroup $x_controls if (type_group=="Political ingroup" | type_group=="Political outgroup" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
* Majority ingroup vs. Roma
eststo: reg stick_to_default covid_prime outgroup covid_outgroup $x_controls if (type_group=="Majority ingroup" | type_group=="Roma outgroup"), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
* Majority ingroup vs. Immigrant
eststo: reg stick_to_default covid_prime outgroup covid_outgroup $x_controls if (type_group=="Majority ingroup" | type_group=="Immigrant outgroup" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"
* Religion ingroup vs. Religion outgroup
eststo: reg stick_to_default covid_prime outgroup covid_outgroup $x_controls if (type_group=="Religion ingroup" | type_group=="Religion outgroup" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
lincom covid_prime + covid_outgroup
scalar cov_covout = r(p)
estadd local cov_lintest "`: di %3.2f scalar(cov_covout)'"

esttab using "$outputpath/Tables/Table_S8_PanelD.csv", replace ///
	title("Panel D: Sticking to the default (= 1 if Help-or-Harm task allocation = 100) (DOMESTIC ingroup vs. DOMESTIC outgroup)")  ///
	mtitle(DOMESTIC Region Political Roma Immigrant Religion) ///
	keep(covid_prime outgroup covid_outgroup) ///
	coeflabels(covid_prime "Covid" outgroup "Outgroup" covid_outgroup "COVID*Outgroup" _cons "Constant") ///
	p brackets nostar ///
	stats(cov_lintest sn_clust N, fmt(2 0) labels("COVID + COVID*Outgroup p-value" "# Clusters" "Observations"))
	* _cons
	estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime outgroup covid_outgroup)
}

***************************************************************************************************************************************************
* Table S9: Interaction-effects specification: Effect of the COVID-19 condition on the amount allocated in the Help-or-Harm task, by the identity of the recipient (alternative domestic benchmark groups vs. foreign)
{
*******************************
*Panel A: Foreign vs. Domestic (generic)
{	
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear

gen foreign = type_index=="FOREIGN"
gen covid_foreign=foreign*covid_prime

global x_controls $basic_controls

eststo clear
*CZ vs. Foreign
eststo : reg HHT covid_prime foreign covid_foreign $x_controls if (type_index=="DOMESTIC" | type_index=="FOREIGN" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* Asia
eststo: reg HHT covid_prime foreign covid_foreign $x_controls if (type_index=="DOMESTIC" | type_group=="Asia" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* EU
eststo: reg HHT covid_prime foreign covid_foreign $x_controls if (type_index=="DOMESTIC" | type_group=="EU" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* USA
eststo: reg HHT covid_prime foreign covid_foreign $x_controls if (type_index=="DOMESTIC" | type_group=="USA" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* Africa
eststo: reg HHT covid_prime foreign covid_foreign $x_controls if (type_index=="DOMESTIC" | type_group=="Africa" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"


esttab using "$outputpath/Tables/Table_S9_PanelA.csv", replace ///
	title("Panel A: Amount sent in HHT" ", Foreign vs. Domestic")  ///
	mtitle(Foreign Asia EU USA Africa) ///
	keep(covid_foreign) ///
	coeflabels(covid_prime "Covid-19" foreign "Foreigner" covid_foreign "COVID-19*Foreigner" _cons "Constant") ///
	p brackets nostar ///
	stats(sn_clust N, fmt(2 0) labels("# Clusters" "Observations"))
}

*******************************
*Panel B: Foreign vs. Domestic Majority
{	
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear

gen foreign = type_index=="FOREIGN"
gen covid_foreign=foreign*covid_prime

global x_controls $basic_controls

eststo clear
*CZ vs. Foreign
eststo : reg HHT covid_prime foreign covid_foreign $x_controls if (type_group=="Majority ingroup" | type_index=="FOREIGN" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* Asia
eststo: reg HHT covid_prime foreign covid_foreign $x_controls if (type_group=="Majority ingroup" | type_group=="Asia" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* EU
eststo: reg HHT covid_prime foreign covid_foreign $x_controls if (type_group=="Majority ingroup" | type_group=="EU" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* USA
eststo: reg HHT covid_prime foreign covid_foreign $x_controls if (type_group=="Majority ingroup" | type_group=="USA" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* Africa
eststo: reg HHT covid_prime foreign covid_foreign $x_controls if (type_group=="Majority ingroup" | type_group=="Africa" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"

esttab using "$outputpath/Tables/Table_S9_PanelB.csv", replace ///
	title("Panel B: Amount sent in HHT" ", Foreign vs. Domestic majority")  ///
	mtitle(Foreign Asia EU USA Africa) ///
	keep(covid_foreign) ///
	coeflabels(covid_prime "Covid-19" foreign "Foreigner" covid_foreign "COVID-19*Foreigner" _cons "Constant") ///
	p brackets nostar ///
	stats(sn_clust N, fmt(2 0) labels("# Clusters" "Observations"))
}
*******************************
*Panel C: Foreign vs. Domestic out-group
{	
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear

gen foreign = type_index=="FOREIGN"
gen covid_foreign=foreign*covid_prime

global x_controls $basic_controls

eststo clear
*CZ vs. Foreign
eststo : reg HHT covid_prime foreign covid_foreign $x_controls if (type_index=="DOMESTIC outgroup" | type_index=="FOREIGN" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* Asia
eststo: reg HHT covid_prime foreign covid_foreign $x_controls if (type_index=="DOMESTIC outgroup" | type_group=="Asia" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* EU
eststo: reg HHT covid_prime foreign covid_foreign $x_controls if (type_index=="DOMESTIC outgroup" | type_group=="EU" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* USA
eststo: reg HHT covid_prime foreign covid_foreign $x_controls if (type_index=="DOMESTIC outgroup" | type_group=="USA" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* Africa
eststo: reg HHT covid_prime foreign covid_foreign $x_controls if (type_index=="DOMESTIC outgroup" | type_group=="Africa" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"

esttab using "$outputpath/Tables/Table_S9_PanelC.csv", replace ///
	title("Panel C: Amount sent in HHT" ", Foreign vs. Domestic out-group")  ///
	mtitle(Foreign Asia EU USA Africa) ///
	keep(covid_foreign) ///
	coeflabels(covid_prime "Covid-19" foreign "Foreigner" covid_foreign "COVID-19*Foreigner" _cons "Constant") ///
	p brackets nostar ///
	stats(sn_clust N, fmt(2 0) labels("# Clusters" "Observations"))
}

*******************************
*Panel D: Foreign vs. Region out-group
{	
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear

gen foreign = type_index=="FOREIGN"
gen covid_foreign=foreign*covid_prime

global x_controls $basic_controls

eststo clear
*CZ vs. Foreign
eststo : reg HHT covid_prime foreign covid_foreign $x_controls if (type_group=="Region outgroup" | type_index=="FOREIGN" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* Asia
eststo: reg HHT covid_prime foreign covid_foreign $x_controls if (type_group=="Region outgroup" | type_group=="Asia" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* EU
eststo: reg HHT covid_prime foreign covid_foreign $x_controls if (type_group=="Region outgroup" | type_group=="EU" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* USA
eststo: reg HHT covid_prime foreign covid_foreign $x_controls if (type_group=="Region outgroup" | type_group=="USA" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* Africa
eststo: reg HHT covid_prime foreign covid_foreign $x_controls if (type_group=="Region outgroup" | type_group=="Africa" ), cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"

esttab using "$outputpath/Tables/Table_S9_PanelD.csv", replace ///
	title("Panel D: Amount sent in HHT" ", Foreign vs. Region out-group")  ///
	mtitle(Foreign Asia EU USA Africa) ///
	keep(covid_foreign) ///
	coeflabels(covid_prime "Covid-19" foreign "Foreigner" covid_foreign "COVID-19*Foreigner" _cons "Constant") ///
	p brackets nostar ///
	stats(sn_clust N, fmt(2 0) labels("# Clusters" "Observations"))
}
}

***************************************************************************************************
** Table S10. Interaction-effects specification: Effect of the COVID-19 condition on the prevalence of hostile behavior in the Help-or-Harm task, by the identity of the recipient (alternative domestic benchmark groups vs. foreign)
{
*******************************
*Panel A: Foreign vs. Domestic (generic)
{
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear

gen foreign = type_index=="FOREIGN"
gen covid_foreign=foreign*covid_prime

eststo clear
* FOREIGN
eststo  : reg antisocial covid_prime foreign covid_foreign $basic_controls if type_index=="DOMESTIC" | type_index=="FOREIGN", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* Asia
eststo  : reg antisocial covid_prime foreign covid_foreign $basic_controls if type_index=="DOMESTIC" | type_group=="Asia", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* EU
eststo  : reg antisocial covid_prime foreign covid_foreign $basic_controls if type_index=="DOMESTIC" | type_group=="EU", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* USA
eststo  : reg antisocial covid_prime foreign covid_foreign $basic_controls if type_index=="DOMESTIC" | type_group=="USA", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* Africa
eststo  : reg antisocial covid_prime foreign covid_foreign $basic_controls if type_index=="DOMESTIC" | type_group=="Africa", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
	
esttab  using "$outputpath/Tables/Table_S10_PanelA.csv", replace ///
	title("Panel A: Hostile behavior (= 1 if Help-or-Harm task allocation < 100)" ", Foreign vs. Domestic")  ///
	mtitle(Foreign Asia EU USA Africa) ///
	keep(covid_foreign) ///
	coeflabels(covid_prime "COVID" foreign "Foreign" covid_foreign "COVID*Foreign" _cons "Constant") ///
	p brackets  nostar ///
	stats(sn_clust N, fmt(2 0) labels("# Clusters" "Observations"))

}
*******************************
*Panel B: Foreign vs. Domestic majority
{
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear

gen foreign = type_index=="FOREIGN"
gen covid_foreign=foreign*covid_prime

eststo clear
* FOREIGN
eststo  : reg antisocial covid_prime foreign covid_foreign $basic_controls if type_group=="Majority ingroup" | type_index=="FOREIGN", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* Asia
eststo  : reg antisocial covid_prime foreign covid_foreign $basic_controls if type_group=="Majority ingroup" | type_group=="Asia", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* EU
eststo  : reg antisocial covid_prime foreign covid_foreign $basic_controls if type_group=="Majority ingroup" | type_group=="EU", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* USA
eststo  : reg antisocial covid_prime foreign covid_foreign $basic_controls if type_group=="Majority ingroup" | type_group=="USA", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* Africa
eststo  : reg antisocial covid_prime foreign covid_foreign $basic_controls if type_group=="Majority ingroup" | type_group=="Africa", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
	
esttab  using "$outputpath/Tables/Table_S10_PanelB.csv", replace ///
	title("Panel B: Hostile behavior (= 1 if Help-or-Harm task allocation < 100)" ", Foreign vs. Domestic majority")  ///
	mtitle(Foreign Asia EU USA Africa) ///
	keep(covid_foreign) ///
	coeflabels(covid_prime "COVID" foreign "Foreign" covid_foreign "COVID*Foreign" _cons "Constant") ///
	p brackets  nostar ///
	stats(sn_clust N, fmt(2 0) labels("# Clusters" "Observations"))

}
*******************************
*Panel C: Foreign vs. Domestic out-group
{
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear

gen foreign = type_index=="FOREIGN"
gen covid_foreign=foreign*covid_prime

eststo clear
* FOREIGN
eststo  : reg antisocial covid_prime foreign covid_foreign $basic_controls if type_index=="DOMESTIC outgroup" | type_index=="FOREIGN", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* Asia
eststo  : reg antisocial covid_prime foreign covid_foreign $basic_controls if type_index=="DOMESTIC outgroup" | type_group=="Asia", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* EU
eststo  : reg antisocial covid_prime foreign covid_foreign $basic_controls if type_index=="DOMESTIC outgroup" | type_group=="EU", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* USA
eststo  : reg antisocial covid_prime foreign covid_foreign $basic_controls if type_index=="DOMESTIC outgroup" | type_group=="USA", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* Africa
eststo  : reg antisocial covid_prime foreign covid_foreign $basic_controls if type_index=="DOMESTIC outgroup" | type_group=="Africa", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
	
esttab  using "$outputpath/Tables/Table_S10_PanelC.csv", replace ///
	title("Panel C: Hostile behavior (= 1 if Help-or-Harm task allocation < 100)" ", Foreign vs. Domestic out-group")  ///
	mtitle(Foreign Asia EU USA Africa) ///
	keep(covid_foreign) ///
	coeflabels(covid_prime "COVID" foreign "Foreign" covid_foreign "COVID*Foreign" _cons "Constant") ///
	p brackets  nostar ///
	stats(sn_clust N, fmt(2 0) labels("# Clusters" "Observations"))
}

*******************************
*Panel D: Foreign vs. Region out-group
{
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear

gen foreign = type_index=="FOREIGN"
gen covid_foreign=foreign*covid_prime

eststo clear
* FOREIGN
eststo  : reg antisocial covid_prime foreign covid_foreign $basic_controls if type_group=="Region outgroup" | type_index=="FOREIGN", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* Asia
eststo  : reg antisocial covid_prime foreign covid_foreign $basic_controls if type_group=="Region outgroup" | type_group=="Asia", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* EU
eststo  : reg antisocial covid_prime foreign covid_foreign $basic_controls if type_group=="Region outgroup" | type_group=="EU", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* USA
eststo  : reg antisocial covid_prime foreign covid_foreign $basic_controls if type_group=="Region outgroup" | type_group=="USA", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
* Africa
eststo  : reg antisocial covid_prime foreign covid_foreign $basic_controls if type_group=="Region outgroup" | type_group=="Africa", cluster(respondentId)
scalar n_clust = e(N_clust)
estadd local sn_clust "`: di %3.0f scalar(n_clust)'"
	
esttab  using "$outputpath/Tables/Table_S10_PanelD.csv", replace ///
	title("Panel D: Hostile behavior (= 1 if Help-or-Harm task allocation < 100)" ", Foreign vs. Region out-group")  ///
	mtitle(Foreign Asia EU USA Africa) ///
	keep(covid_foreign) ///
	coeflabels(covid_prime "COVID" foreign "Foreign" covid_foreign "COVID*Foreign" _cons "Constant") ///
	p brackets  nostar ///
	stats(sn_clust N, fmt(2 0) labels("# Clusters" "Observations"))

}
}

***************************************************************************************************
** Table S11. Effect of the COVID-19 condition on the amount allocated in the Help-or-Harm task, by the identity of the recipient (domestic vs. foreign), only the first block of decisions in the HHT
{
/*
A1: Region same, Region different, Prague (all living in the Czech Republic)
A2: Political same, Political different (all living in the Czech Republic)
A3: Majority ethnicity, Roma ethnicity (all living in the Czech Republic)
A4: Person living in the Czech Republic, Immigrant (all living in the Czech Republic)
B1: EU, USA, Africa, Asia
B2: Atheist, Christian, Muslim, Jew (all living in the Czech Republic)
*/
***************************************************************************************
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear
tab type_group
tab order_A
tab order_A, nolabel
tab order_B2first 
tab order_Bfirst
tab order_Bfirst order_B2first
tab order_A order_Bfirst


gen order_first_block=0
replace order_first_block=1 if (type_index=="FOREIGN" ) & order_Bfirst & !order_B2first
replace order_first_block=1 if (type_group=="Religion ingroup" | type_group=="Religion outgroup") & order_Bfirst & order_B2first
replace order_first_block=1 if (type_group=="DOMESTIC" | type_group=="Immigrant outgroup") & !order_Bfirst & (order_A>=19 & order_A<=24)
replace order_first_block=1 if (type_group=="Majority ingroup" | type_group=="Roma outgroup") & !order_Bfirst & (order_A>=13 & order_A<=18)
replace order_first_block=1 if (type_group=="Region ingroup" | type_group=="Region outgroup") & !order_Bfirst & (order_A>=1 & order_A<=6)
replace order_first_block=1 if (type_group=="Political ingroup" | type_group=="Political outgroup") & !order_Bfirst & (order_A>=7 & order_A<=12)
tab type_group order_first_block

   
****Only the first block of the HHT
eststo clear
*Controls - not controling for order effects, as these are by definition irrelevant for the very first blocks
*global x_controls $basic_controls
global x_controls female d_age_cat2 d_age_cat3 d_age_cat4 d_age_cat5 d_age_cat6 hsize children d_region2 d_region3 d_region4 d_region5 d_region6 d_region7 d_region8 d_region9 d_region10 d_region11 d_region12 d_region13 d_region14 d_townsize2 d_townsize3 d_townsize4 d_townsize5 d_townsize6 d_townsize7 d_educ2 d_educ3 d_educ4 d_estat2 d_estat3 d_estat4 d_estat5 d_estat6 d_estat7 d_CNP_hincome2 d_CNP_hincome3 d_CNP_hincome4 d_CNP_hincome5 d_CNP_hincome6 d_CNP_hincome7 d_CNP_hincome8 d_CNP_hincome9 d_CNP_hincome10 d_CNP_hincome11
eststo  : reg HHT covid_prime  $x_controls if type_index=="DOMESTIC" & order_first_block, cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if type_index=="FOREIGN" & order_first_block, cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if type_group=="Asia" & order_first_block, cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if type_group=="EU" & order_first_block, cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if type_group=="USA" & order_first_block, cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if type_group=="Africa" & order_first_block, cluster(respondentId)
esttab using "$outputpath/Tables/Table_S11.csv", replace ///
	title(Effect of covid prime on the amount allocated: Domestic vs. Foreign, only the first block of decisions in the HHT)  ///
	mtitle("Domestic" Foreign Asia "European Union" USA Africa) ///
	keep(covid_prime) ///
	coeflabels(covid_prime "COVID-19") ///
	p brackets  nostar ///
	stats(N, fmt(0 0) labels("Observations"))
	* _cons
	*CONTROL mean
	sum HHT if (type_index=="DOMESTIC") & order_first_block & !covid_prime
	sum HHT if (type_index=="FOREIGN") & order_first_block & !covid_prime
	sum HHT if (type_group=="Asia") & order_first_block & !covid_prime
	sum HHT if (type_group=="EU") & order_first_block & !covid_prime
	sum HHT if (type_group=="USA") & order_first_block & !covid_prime
	sum HHT if (type_group=="Africa") & order_first_block & !covid_prime	
}

***************************************************************************************************
** Table S12. Effect of the COVID-19 condition on the amount allocated in the Help-or-Harm task, by the identity of the recipient (domestic in-group vs. domestic out-group), only the first block of decisions in the HHT
{
/*
A1: Region same, Region different, Prague (all living in the Czech Republic)
A2: Political same, Political different (all living in the Czech Republic)
A3: Majority ethnicity, Roma ethnicity (all living in the Czech Republic)
A4: Person living in the Czech Republic, Immigrant (all living in the Czech Republic)
B1: EU, USA, Africa, Asia
B2: Atheist, Christian, Muslim, Jew (all living in the Czech Republic)
*/
***************************************************************************************
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear
tab type_group
tab order_A
tab order_A, nolabel
tab order_B2first 
tab order_Bfirst
tab order_Bfirst order_B2first
tab order_A order_Bfirst


gen order_first_block=0
replace order_first_block=1 if (type_index=="FOREIGN" ) & order_Bfirst & !order_B2first
replace order_first_block=1 if (type_group=="Religion ingroup" | type_group=="Religion outgroup") & order_Bfirst & order_B2first
replace order_first_block=1 if (type_group=="DOMESTIC" | type_group=="Immigrant outgroup") & !order_Bfirst & (order_A>=19 & order_A<=24)
replace order_first_block=1 if (type_group=="Majority ingroup" | type_group=="Roma outgroup") & !order_Bfirst & (order_A>=13 & order_A<=18)
replace order_first_block=1 if (type_group=="Region ingroup" | type_group=="Region outgroup") & !order_Bfirst & (order_A>=1 & order_A<=6)
replace order_first_block=1 if (type_group=="Political ingroup" | type_group=="Political outgroup") & !order_Bfirst & (order_A>=7 & order_A<=12)
tab type_group order_first_block

   
****Only the first block of the HHT
eststo clear
*Controls - not controling for order effects, as these are by definition irrelevant for the very first blocks
*global x_controls $basic_controls
global x_controls female d_age_cat2 d_age_cat3 d_age_cat4 d_age_cat5 d_age_cat6 hsize children d_region2 d_region3 d_region4 d_region5 d_region6 d_region7 d_region8 d_region9 d_region10 d_region11 d_region12 d_region13 d_region14 d_townsize2 d_townsize3 d_townsize4 d_townsize5 d_townsize6 d_townsize7 d_educ2 d_educ3 d_educ4 d_estat2 d_estat3 d_estat4 d_estat5 d_estat6 d_estat7 d_CNP_hincome2 d_CNP_hincome3 d_CNP_hincome4 d_CNP_hincome5 d_CNP_hincome6 d_CNP_hincome7 d_CNP_hincome8 d_CNP_hincome9 d_CNP_hincome10 d_CNP_hincome11
*All ingroup outgroup
		eststo  : reg HHT covid_prime  $x_controls if (type_index=="DOMESTIC ingroup") & order_first_block, cluster(respondentId)
		eststo  : reg HHT covid_prime  $x_controls if (type_index=="DOMESTIC outgroup") & order_first_block , cluster(respondentId)
		*Region
		eststo  : reg HHT covid_prime  $x_controls if (type_group=="Region ingroup") & order_first_block, cluster(respondentId)
		eststo  : reg HHT covid_prime  $x_controls if (type_group=="Region outgroup") & order_first_block, cluster(respondentId)
		*Political
		eststo  : reg HHT covid_prime  $x_controls if (type_group=="Political ingroup") & order_first_block, cluster(respondentId)
		eststo  : reg HHT covid_prime  $x_controls if (type_group=="Political outgroup")  & order_first_block, cluster(respondentId)
		*Ethnicity
		eststo  : reg HHT covid_prime  $x_controls if (type_group=="Majority ingroup") & order_first_block, cluster(respondentId)
		eststo  : reg HHT covid_prime  $x_controls if (type_group=="Roma outgroup") & order_first_block, cluster(respondentId)
		*Migrant (chudak osamocenej)
		eststo  : reg HHT covid_prime  $x_controls if (type_group=="Immigrant outgroup") & order_first_block, cluster(respondentId)
		*Religion
		eststo: reg HHT covid_prime $x_controls if (type_group=="Religion ingroup") & order_first_block, cluster(respondentId)
		eststo: reg HHT covid_prime  $x_controls if (type_group=="Religion outgroup") & order_first_block, cluster(respondentId)
		esttab using "$outputpath/Tables/Table_S12.csv", replace  ///
			title(Effect of covid prime on pro/anti-social behavior: Foreign)  ///
			mtitle("Domestic in-group" "Domestic out-group" "Region in-group" "Region out-group" "Political in-group" "Political out-group" "Majority in-group" "Roma ethnicity out-group" "Migrant out-group" "Religion in-group" "Religion out-group") ///
			keep(covid_prime) ///
			coeflabels(covid_prime "COVID-19") ///
			p brackets nostar  ///
			stats(N, fmt(0 0) labels("Observations"))
			*CONTROL mean
			sum HHT if (type_index=="DOMESTIC ingroup") & order_first_block & !covid_prime
			sum HHT if (type_index=="DOMESTIC outgroup") & order_first_block & !covid_prime
			sum HHT if (type_group=="Region ingroup") & order_first_block & !covid_prime
			sum HHT if (type_group=="Region outgroup") & order_first_block & !covid_prime
			sum HHT if (type_group=="Political ingroup") & order_first_block & !covid_prime
			sum HHT if (type_group=="Political outgroup") & order_first_block & !covid_prime
			sum HHT if (type_group=="Majority ingroup") & order_first_block & !covid_prime
			sum HHT if (type_group=="Roma outgroup") & order_first_block & !covid_prime
			sum HHT if (type_group=="Immigrant outgroup") & order_first_block & !covid_prime
			sum HHT if (type_group=="Religion ingroup") & order_first_block & !covid_prime
			sum HHT if (type_group=="Religion outgroup") & order_first_block & !covid_prime
}

***************************************************************************************************
** Table S13. Robustness checks default, attention, response time 
{
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear

eststo clear
quietly eststo  : reg stick_to_default covid_prime $basic_controls if (type_index=="DOMESTIC" | type_group=="Asia"  | type_group=="EU"  | type_group=="USA"  | type_group=="Africa" | type_group=="Region ingroup" | type_group=="Region outgroup" | type_group=="Political ingroup" | type_group=="Political outgroup"  | type_group=="Majority ingroup" | type_group=="Roma outgroup" | type_group=="Immigrant outgroup"  | type_group=="Religion ingroup" | type_group=="Religion outgroup"   ) , cluster(respondentId)
quietly eststo  : reg attentive covid_prime $basic_controls if type_index=="DOMESTIC", cluster(respondentId)
quietly eststo  : reg exp_time_min covid_prime $basic_controls if type_index=="DOMESTIC", cluster(respondentId)

esttab using "$outputpath/Tables/Table_S13.csv", replace ///
	title(Panel A: Domestic)  ///
	mtitle("Sticking to default (d)" "Attentive (d)" "Decision time") ///
	keep(covid_prime _cons) ///
	coeflabels(covid_prime "COVID") ///
	p brackets nostar ///
	stats(N, fmt(0 0) labels("Observations"))
	
estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)

sum stick_to_default if covid_prime==0 
sum attentive if covid_prime==0 & type_index=="DOMESTIC"
sum exp_time_min if covid_prime==0 & type_index=="DOMESTIC"
}

***************************************************************************************************
** Table S14. Robustness checks DOMESTIC, FOREIGN, ASIA, controling for attention and response time 
{
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear


* Panel A: Controling for attention
eststo clear
quietly eststo  : reg HHT covid_prime attentive $basic_controls if type_index=="DOMESTIC", cluster(respondentId)
quietly eststo  : reg HHT covid_prime attentive $basic_controls if type_index=="FOREIGN", cluster(respondentId)
quietly eststo  : reg HHT covid_prime attentive $basic_controls if type_group=="EU", cluster(respondentId)


esttab using "$outputpath/Tables/Table_S14_PanelA.csv", replace ///
	title(Panel A: Controlling for passing both attention checks)  ///
	mtitle("Help-or-Harm task allocation" "Help-or-Harm task allocation" "Help-or-Harm task allocation") ///
	keep(covid_prime _cons) ///
	coeflabels(covid_prime "COVID") ///
	p brackets nostar ///
	stats(N, fmt(0 0) labels("Observations"))

estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)
	
sum HHT if covid_prime==0 & type_index=="DOMESTIC"
sum HHT if covid_prime==0 & type_index=="FOREIGN"
sum HHT if covid_prime==0 & type_group=="EU"


* Panel B: Dropping inattentive
eststo clear
quietly eststo  : reg HHT covid_prime $basic_controls if type_index=="DOMESTIC" & attentive, cluster(respondentId)
quietly eststo  : reg HHT covid_prime $basic_controls if type_index=="FOREIGN" & attentive, cluster(respondentId)
quietly eststo  : reg HHT covid_prime $basic_controls if type_group=="EU" & attentive, cluster(respondentId)
 
esttab using "$outputpath/Tables/Table_S14_PanelB.csv", replace ///
	title(Panel B: Excluding inattentive respondents)  ///
	mtitle("Help-or-Harm task allocation" "Help-or-Harm task allocation" "Help-or-Harm task allocation") ///
	keep(covid_prime _cons) ///
	coeflabels(covid_prime "COVID") ///
	p brackets nostar ///
	stats(N, fmt(0 0) labels("Observations"))

estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)

sum HHT if covid_prime==0 & type_index=="DOMESTIC" & attentive
sum HHT if covid_prime==0 & type_index=="FOREIGN" & attentive
sum HHT if covid_prime==0 & type_group=="EU" & attentive


* Panel C: Controling for response time
eststo clear
quietly eststo  : reg HHT covid_prime exp_time_min $basic_controls if type_index=="DOMESTIC", cluster(respondentId)
quietly eststo  : reg HHT covid_prime exp_time_min $basic_controls if type_index=="FOREIGN", cluster(respondentId)
quietly eststo  : reg HHT covid_prime exp_time_min $basic_controls if type_group=="EU", cluster(respondentId)

esttab using "$outputpath/Tables/Table_S14_PanelC.csv", replace ///
	title(Panel C: Controlling for response time)  ///
	mtitle("Help-or-Harm task allocation" "Help-or-Harm task allocation" "Help-or-Harm task allocation") ///
	keep(covid_prime _cons) ///
	coeflabels(covid_prime "COVID") ///
	p brackets nostar ///
	stats(N, fmt(0 0) labels("Observations"))
	
estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)

sum HHT if covid_prime==0 & type_index=="DOMESTIC"
sum HHT if covid_prime==0 & type_index=="FOREIGN"
sum HHT if covid_prime==0 & type_group=="EU"
}

***************************************************************************************************************************************************
* Table S15: Effects by Social Media and Media exposure
{
use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear
global x_controls $basic_controls

sum respondentId
drop social_media_high
tab med_nQ114_r3 if type_index=="DOMESTIC"

recode med_nQ114_r3 (6=0) (5=1) (4=2) (3=3) (2=4) (1=5)
label define media_new 0 "Never" 1 "Less often" 2 "About once a week" 3 "Several times a week" 4 "1-2 times a day" 5 "Many times a day"
label values med_nQ114_r3 media_new
tab med_nQ114_r3 if type_index=="DOMESTIC"
gen social_media_high=med_nQ114_r3>=3 & med_nQ114_r3!=.
tab med_nQ114_r3 social_media_high if type_index=="DOMESTIC"

replace social_media_high=. if med_nQ114_r3==.
label variable social_media_high "High exposure to social media"
label values social_media_high yes_no
tab social_media_high if type_index=="DOMESTIC"

sum med_nQ113_r1 med_nQ113_r2 med_nQ113_r3 med_nQ113_r4 med_nQ113_r5 med_nQ113_r6 med_nQ113_r7 med_nQ113_r8 med_nQ113_r9 med_nQ113_r10 med_nQ113_r11 med_nQ113_r12
foreach x in med_nQ113_r1 med_nQ113_r2 med_nQ113_r3 med_nQ113_r4 med_nQ113_r5 med_nQ113_r6 med_nQ113_r7 med_nQ113_r8 med_nQ113_r9 med_nQ113_r10 med_nQ113_r11 med_nQ113_r12 {
	recode `x' (6=0) (5=1) (4=2) (3=3) (2=4) (1=5)
 label values `x' media_new
}
egen media= rowtotal(med_nQ113_r1 med_nQ113_r2 med_nQ113_r3 med_nQ113_r4 med_nQ113_r5 med_nQ113_r6 med_nQ113_r7 med_nQ113_r8 med_nQ113_r9 med_nQ113_r10 med_nQ113_r11 med_nQ113_r12)
replace media=. if media==0
replace media=media/12
tab media 
sum media, d
gen media_high=media>=1.25 // above median media exposure
tab media media_high
replace media_high=. if media==.
label variable media_high "High media exposure"
label values media_high yes_no
tab media media_high if type_index=="DOMESTIC"

** Panel A: High social media exposure
eststo clear
eststo  : reg HHT covid_prime  $x_controls if social_media_high==1 & type_index=="DOMESTIC", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if social_media_high==1 & type_index=="FOREIGN", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if social_media_high==1 & type_group=="Asia", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if social_media_high==1 & type_group=="EU", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if social_media_high==1 & type_group=="USA", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if social_media_high==1 & type_group=="Africa", cluster(respondentId)
	
	esttab using "$outputpath/Tables/Table_S15_PanelA.csv", replace ///
	title(Effect of covid prime on pro/anti-social behavior: Foreign, High social media exposure)  ///
	mtitle("Domestic" "Foreign" "Asian" "European Union" "United States" "African") ///
	keep(covid_prime) ///
	coeflabels(covid_prime "COVID") ///
	p brackets  nostar ///
	stats(N, fmt(0 0) labels("Observations"))
	* _cons
	estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)
	
	*mean control	
	sum HHT if (type_index=="DOMESTIC") & social_media_high==1  & !covid_prime
	sum HHT if (type_index=="FOREIGN") & social_media_high==1  & !covid_prime
	sum HHT if (type_group=="Asia") & social_media_high==1  & !covid_prime
	sum HHT if (type_group=="EU") & social_media_high==1  & !covid_prime
	sum HHT if (type_group=="USA") & social_media_high==1  & !covid_prime
	sum HHT if (type_group=="Africa") & social_media_high==1  & !covid_prime
	
	
** Panel B: Low social media exposure
eststo clear
eststo  : reg HHT covid_prime  $x_controls if social_media_high==0 & type_index=="DOMESTIC", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if social_media_high==0 & type_index=="FOREIGN", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if social_media_high==0 & type_group=="Asia", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if social_media_high==0 & type_group=="EU", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if social_media_high==0 & type_group=="USA", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if social_media_high==0 & type_group=="Africa", cluster(respondentId)
	
	esttab using "$outputpath/Tables/Table_S15_PanelB.csv", replace ///
	title(Effect of covid prime on pro/anti-social behavior: Foreign, Low social media exposure)  ///
	mtitle("Domestic" "Foreign" "Asian" "European Union" "United States" "African") ///
	keep(covid_prime) ///
	coeflabels(covid_prime "COVID") ///
	p brackets  nostar ///
	stats(N, fmt(0 0) labels("Observations"))
	* _cons
	estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)
	
	*mean control	
	sum HHT if (type_index=="DOMESTIC") & social_media_high==0 & !covid_prime
	sum HHT if (type_index=="FOREIGN") & social_media_high==0 & !covid_prime
	sum HHT if (type_group=="Asia") & social_media_high==0 & !covid_prime
	sum HHT if (type_group=="EU") & social_media_high==0 & !covid_prime
	sum HHT if (type_group=="USA") & social_media_high==0 & !covid_prime
	sum HHT if (type_group=="Africa") & social_media_high==0 & !covid_prime
	
** Panel C: High media exposure
eststo clear
eststo  : reg HHT covid_prime  $x_controls if media_high==1 & type_index=="DOMESTIC", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if media_high==1 & type_index=="FOREIGN", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if media_high==1 & type_group=="Asia", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if media_high==1 & type_group=="EU", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if media_high==1 & type_group=="USA", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if media_high==1 & type_group=="Africa", cluster(respondentId)
	
	esttab using "$outputpath/Tables/Table_S15_PanelC.csv", replace ///
	title(Effect of covid prime on pro/anti-social behavior: Foreign, High media exposure)  ///
	mtitle("Domestic" "Foreign" "Asian" "European Union" "United States" "African") ///
	keep(covid_prime) ///
	coeflabels(covid_prime "COVID") ///
	p brackets  nostar ///
	stats(N, fmt(0 0) labels("Observations"))
	* _cons
	estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)
	
	*mean control		
	sum HHT if (type_index=="DOMESTIC") & media_high==1 & !covid_prime
	sum HHT if (type_index=="FOREIGN") & media_high==1 & !covid_prime
	sum HHT if (type_group=="Asia") & media_high==1 & !covid_prime
	sum HHT if (type_group=="EU") & media_high==1 & !covid_prime
	sum HHT if (type_group=="USA") & media_high==1 & !covid_prime
	sum HHT if (type_group=="Africa") & media_high==1 & !covid_prime
	
** Panel D: Low media exposure
eststo clear
eststo  : reg HHT covid_prime  $x_controls if media_high==0 & type_index=="DOMESTIC", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if media_high==0 & type_index=="FOREIGN", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if media_high==0 & type_group=="Asia", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if media_high==0 & type_group=="EU", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if media_high==0 & type_group=="USA", cluster(respondentId)
eststo  : reg HHT covid_prime  $x_controls if media_high==0 & type_group=="Africa", cluster(respondentId)
	
	esttab using "$outputpath/Tables/Table_S15_PanelD.csv", replace ///
	title(Effect of covid prime on pro/anti-social behavior: Foreign, Low media exposure)  ///
	mtitle("Domestic" "Foreign" "Asian" "European Union" "United States" "African") ///
	keep(covid_prime) ///
	coeflabels(covid_prime "COVID") ///
	p brackets  nostar ///
	stats(N, fmt(0 0) labels("Observations"))
	* _cons
	estout *, cells(ci(fmt(%8.2f) par([ , ])) t(fmt(%8.2f))) keep(covid_prime)
	
	*mean control	
	sum HHT if (type_index=="DOMESTIC") & media_high==0 & !covid_prime
	sum HHT if (type_index=="FOREIGN") & media_high==0 & !covid_prime
	sum HHT if (type_group=="Asia") & media_high==0 & !covid_prime
	sum HHT if (type_group=="EU") & media_high==0 & !covid_prime
	sum HHT if (type_group=="USA") & media_high==0 & !covid_prime
	sum HHT if (type_group=="Africa") & media_high==0 & !covid_prime
}

***************************************************************************************************
* Table S16: Covid-19 shocks
***************************************************************************************************
{
use "$cleandatapath/covid_fuels_hostility_clean.dta", clear

*Column 1-3
orth_out income_drop hworkdiffw1w0 hworkdiffw2w0 job_loss nQ51_1_1 payment_problems sav_monthandless sav_weeks happiness dep_anx pss4 nQ55_0_0 nQ55_1_0 nQ55_2_0 nQ55_3_0 nQ55_4_0 nQ55_5_0 nQ55_6_0 nQ55_7_0 traveled traveled_hh know_covid know_covid_hh know_quarantine activities_w1 activities_hh_w1 not_working_w1 not_meeting_anyone_w1 activities_w2 activities_hh_w2 not_working_w2 not_meeting_anyone_w2 preventive_measures tested tested_hh symptoms contact_medical health_issue_hh, by(covid_prime) overall pcompare count bdec(2) 
*count in orth_out gives maximum number of observations among all variables, is not correct for all

*Column 7: check number of observations using sum
sum income_drop hworkdiffw1w0 hworkdiffw2w0 job_loss nQ51_1_1 payment_problems sav_monthandless sav_weeks happiness dep_anx pss4 nQ55_0_0 nQ55_1_0 nQ55_2_0 nQ55_3_0 nQ55_4_0 nQ55_5_0 nQ55_6_0 nQ55_7_0 traveled traveled_hh know_covid know_covid_hh know_quarantine activities_w1 activities_hh_w1 not_working_w1 not_meeting_anyone_w1 activities_w2 activities_hh_w2 not_working_w2 not_meeting_anyone_w2 preventive_measures tested tested_hh symptoms contact_medical health_issue_hh, sep(50)

*Column 5: sample mean weighted
*has to be done separately for variables where we do not have all observations
*Panel A
mean income_drop [pweight=repre_weights]
mean hworkdiffw1w0 hworkdiffw2w0 [pweight=repre_weights]
mean job_loss [pweight=repre_weights]
mean nQ51_1_1 [pweight=repre_weights]
*Panel B-E
mean payment_problems sav_monthandless sav_weeks happiness dep_anx pss4 nQ55_0_0 nQ55_1_0 nQ55_2_0 nQ55_3_0 nQ55_4_0 nQ55_5_0 nQ55_6_0 nQ55_7_0 traveled traveled_hh know_covid know_covid_hh know_quarantine activities_w1 activities_hh_w1 not_working_w1 not_meeting_anyone_w1 activities_w2 activities_hh_w2 not_working_w2 not_meeting_anyone_w2 preventive_measures tested tested_hh symptoms contact_medical health_issue_hh [pweight=repre_weights]


* display full variable labels
foreach var of varlist income_drop hworkdiffw1w0 hworkdiffw2w0 job_loss nQ51_1_1 payment_problems sav_monthandless sav_weeks happiness dep_anx pss4 nQ55_0_0 nQ55_1_0 nQ55_2_0 nQ55_3_0 nQ55_4_0 nQ55_5_0 nQ55_6_0 nQ55_7_0 traveled traveled_hh know_covid know_covid_hh know_quarantine activities_w1 activities_hh_w1 not_working_w1 not_meeting_anyone_w1 activities_w2 activities_hh_w2 not_working_w2 not_meeting_anyone_w2 preventive_measures tested tested_hh symptoms contact_medical health_issue_hh  {
	di "`var'" _col(20) "`: var l `var''"
	}

* tests 
ranksum income_drop, by(covid_prime)
ranksum hworkdiffw1w0, by(covid_prime)
ranksum hworkdiffw2w0, by(covid_prime)
tab job_loss covid_prime, chi2 exact
ranksum nQ51_1_1, by(covid_prime)

tab payment_problems covid_prime, chi2 exact
tab sav_monthandless covid_prime, chi2 exact
ranksum sav_weeks, by(covid_prime)

ranksum happiness, by(covid_prime)
ranksum dep_anx, by(covid_prime)
ranksum pss4, by(covid_prime)

tab nQ55_0_0 covid_prime, chi2 exact
tab nQ55_1_0 covid_prime, chi2 exact
tab nQ55_2_0 covid_prime, chi2 exact
tab nQ55_3_0 covid_prime, chi2 exact
tab nQ55_4_0 covid_prime, chi2 exact
tab nQ55_5_0 covid_prime, chi2 exact
tab nQ55_6_0 covid_prime, chi2 exact
tab nQ55_7_0 covid_prime, chi2 exact

tab traveled covid_prime, chi2 exact
tab traveled_hh covid_prime, chi2 exact
tab know_covid covid_prime, chi2 exact
tab know_covid_hh covid_prime, chi2 exact
tab know_quarantine covid_prime, chi2 exact
ranksum activities_w1, by(covid_prime)
ranksum activities_hh_w1, by(covid_prime)
tab not_working_w1 covid_prime, chi2 exact
tab not_meeting_anyone_w1 covid_prime, chi2 exact
ranksum activities_w2, by(covid_prime)
ranksum activities_hh_w2, by(covid_prime)
tab not_working_w2 covid_prime, chi2 exact
tab not_meeting_anyone_w2 covid_prime, chi2 exact
ranksum preventive_measures, by(covid_prime)
tab tested covid_prime, chi2 exact
tab tested_hh covid_prime, chi2 exact
ranksum symptoms, by(covid_prime)
tab contact_medical covid_prime, chi2 exact
tab health_issue_hh covid_prime, chi2 exact

}
log close
